[ create a new paste ] login | about

Link: http://codepad.org/618X0Jqc    [ raw code | output | fork ]

Ruby, pasted on Jul 6:
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


Output:
1
2
Line 9:in `that_method': undefined method `[]=' for nil:NilClass (NoMethodError)
	from t.rb:17


Create a new paste based on this one


Comments: