1 2 3 4 5 6 7 8 9 10 11 12 13
class Foo @foo = { 'test' => {'test2' => 'test3'}, 'test4' => {'test5' => 'test6'}, } def mymethod puts self.foo end end instance = Foo.new instance.mymethod
1 2
Line 8:in `mymethod': undefined method `foo' for #<Foo:0xf75528d0> (NoMethodError) from t.rb:13