fork download
  1. class Foo
  2. def initialize (bar)
  3. @bar = bar
  4. end
  5.  
  6. def getBar
  7. return @bar
  8. end
  9. end
  10.  
  11. foo_a = Foo.new(100)
  12. foo_b = Foo.new(200)
  13.  
  14. foo_a_getBar = foo_a.method("getBar")
  15. foo_b_getBar = foo_b.method("getBar")
  16.  
  17. puts foo_a_getBar.call
  18. puts foo_b_getBar.call
  19. puts foo_a_getBar == foo_b_getBar
  20.  
Success #stdin #stdout 0.05s 9656KB
stdin
Standard input is empty
stdout
100
200
false