I just managed to apply Dober's codes into my app (I just copy the code 
into the class, and add some codes), It is just that simple, but works 
fine! Still, I get a problem, inside
>       define_method "save_" << fruit do
>          #HERE
>        end
this method, I need to call a local method with the same name as string 
fruit contains. If it is a instance variable, I know there are 
instance_variable_set("@#{fruit}", str) and 
instance_variable_get("@#{fruit}") methods. But what about this local 
method? How can I read/set its value?

Though the problem inside the class is almost solved, but I still want 
to know the mixin solution, because with mixin solution, I can use these 
code almong other classes.

-- 
Posted via http://www.ruby-forum.com/.