On 27 June 2012 19:54, Ritesh T. <[email protected]> wrote:
> hello, i've come across a code like
>
> def password=(pass)
>  @password = pass
> .
> .
> end
>
> Anyone can please explain to me what is happening in the first line
> itself for the def part? the code I saw did not provide anything on it

It is setting the instance variable @password to the parameter 'pass'
that is passed in to the method.  I suggest running through some basic
Ruby tutorials.

If you meant what is the line starting with def doing, then you still
need to look at the tutorials.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en-US.

Reply via email to