From: Love U Ruby Date: 2013-02-27T02:05:07+09:00 Subject: undefined local variable or method `m' >> 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 => # >> foo.display NameError: undefined local variable or method `m' for # from (irb):7:in `display' from (irb):11 from /usr/bin/irb:12:in `
' -- Posted via http://www.ruby-forum.com/.