watch this: http://www.youtube.com/watch?v=iLxKNUFHAnY
On Tue, Feb 26, 2013 at 12:05 PM, Love U Ruby <[email protected]> wrote: > >> class Test > >> m=self > >> def self.show > >> print "hi" > >> end > >> def display > >> m.show > >> end > >> end > => nil > > Why does the below error come? can anyone help me here? > > >> foo = Test.new > => #<Test:0x0000000106f9b8> > >> foo.display > NameError: undefined local variable or method `m' for > #<Test:0x0000000106f9b8> > from (irb):7:in `display' > from (irb):11 > from /usr/bin/irb:12:in `<main>' > > -- > Posted via http://www.ruby-forum.com/. > > -- [email protected] | https://groups.google.com/d/forum/ruby-talk-google?hl=en --- You received this message because you are subscribed to the Google Groups "ruby-talk-google" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
