1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
class ThisClass def this_method @something_here = { :this => 'defined' } end end class ThatClass def that_method @something_here[:that] = 'defined' end end this = ThisClass.new this.this_method that = ThatClass.new that.that_method
1 2
Line 9:in `that_method': undefined method `[]=' for nil:NilClass (NoMethodError) from t.rb:17