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 -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
On 27 June 2012 19:54, Ritesh T. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> 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 itIt 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.
thanks Colin, I''ve started with the rails tutorials but it was the password=(pass) which confused me somehow -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
On 27 June 2012 20:35, Ritesh T. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> thanks Colin, I''ve started with the rails tutorials but it was the > password=(pass) which confused me somehowHave a look at http://www.rubyist.net/~slagell/ruby/accessors.html 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
thanks for the link, i''ve bought some RoR books to get further info, but if you have some websites with some easy to use examples for a beginner am most welcome to accept them :) -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
please try http://ruby.railstutorial.org 在 2012年6月27日星期三UTC-7下午12时50分52秒,Ruby-Forum.com User写道:> > thanks for the link, i''ve bought some RoR books to get further info, but > if you have some websites with some easy to use examples for a beginner > am most welcome to accept them :) > > -- > Posted via http://www.ruby-forum.com/. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/w0PdcuE8rLIJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org 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.