From: John Feminella Date: 2011-02-18T21:57:32+09:00 Subject: Re: Undefined method `+' Is it an "undefined method '+' on NilClass"? If so, you forgot to assign a value to @plays before incrementing it. You might try something like this instead: def plays @plays ||= 0 end def plays=(v) @plays = self.plays + 1 end ~ jf -- John Feminella Principal Consultant, BitsBuilder LI: http://www.linkedin.com/in/johnxf SO: http://stackoverflow.com/users/75170/ On Thu, Feb 17, 2011 at 23:04, Sam Duncan wrote: > What is the content of @plays? > > Sam > > > On 18/02/11 17:01, Danny L. wrote: >> >> hey guys the following line of code is producing a "undefined method >> `+': >> >>  @plays += 1 >> >> >> cheers, >> >> Danny >> >> > >