From: Chris Hall Date: 2007-10-06T04:22:50+09:00 Subject: Proc comparison i'm having an issue where i need to compare 2 objects by comparing a Proc which is stored in an instance var. however, everything i have tried results in a false comparison. simple example: class Test attr :action def initialize(&block) @action = block_given? ? block : nil end def ==(obj) if obj.is_a?(Test) return @action.eql?(obj.action) end end end t1 = Test.new { puts "hello" } t2 = Test.new { puts "hello" } puts "comp: #{t1 == t2}" puts "t1 action: #{t1.action}" puts "t2 action: #{t2.action}" output: comp: false t1 action: # t2 action: # when the objects are created, i use the same block of code when i create each instance, however, it obvious that from the comparison output they aren't the same. my question, how do i get the comparison i'm looking for? -- Posted via http://www.ruby-forum.com/.