Skip to content

Instantly share code, notes, and snippets.

@nunosilva800
Created September 30, 2016 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nunosilva800/7696d30659b7ec22920008bc9d9b5381 to your computer and use it in GitHub Desktop.
Save nunosilva800/7696d30659b7ec22920008bc9d9b5381 to your computer and use it in GitHub Desktop.
Ruby equalities
irb> 1 == 1.0
=> true # generic equality
irb> 1 === 1.0
=> true # case equality
irb> 1.eql? 1.0
=> false # equality by value
irb> 1.equal? 1.0
=> false # object identity
irb> 'a'.eql? 'a'
=> true # equality by value
irb> 'a'.equal? 'a'
=> false # object equality
@nunosilva800
Copy link
Author

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