Hi,

On Fri, May 25, 2012 at 10:14 AM, Robinson Risquez <lists / ruby-forum.com>wrote:

> > k=0
> > while (k<10) do
> >   puts val.attribute+=1
> >   k+=1
> > end
>
>
> Certainly can be done in many ways, but what I want to do is spend just
> an attribute as a parameter to a method of the form: object.attribute,
> then you can modify this attribute in the method, as follows:
>
>  def adder (attribute)
>   attribute + = 1
>  end
>
>  That's what I do, but can not find the way.
>
>

I'm sorry, just to make the problem more clear.

You mean that you want to modify arbitrary attribute(s) from outside
object, dont' you?

Can you give me some examples with object's state before and after you call
this method.


Sincerely,

-- 
Duong Quang Ha (H Quang Dng in Vietnamese)
blog.haqduong.com