Skip to content

Instantly share code, notes, and snippets.

@ys
Created July 16, 2013 19:56
Show Gist options
  • Save ys/6012099 to your computer and use it in GitHub Desktop.
Save ys/6012099 to your computer and use it in GitHub Desktop.
a = Tempfile.new('e')
=> #<File:/var/folders/xq/42ckp5s51v7gtnwdmnn4r_5m0000gn/T/e20130716-67827-148wsqy>
a == a
=> true
a === a
=> false
@phoet
Copy link

phoet commented Jul 16, 2013

i guess that's due to DelegateClass and Rubies Delegator class

a.equal? a
# => true
a.eql? a
# => false
a.method(:eql?).source_location
# => ["/Users/paule/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/delegate.rb", 292]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment