Ruby on Rails Wednesday, June 27, 2012

On 27 June 2012 19:54, Ritesh T. <lists@ruby-forum.com> 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

No comments:

Post a Comment