Skip to content

Instantly share code, notes, and snippets.

@tatey
Created August 2, 2018 11:37
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 tatey/63999b6cab38bbb32802045be3d9dc27 to your computer and use it in GitHub Desktop.
Save tatey/63999b6cab38bbb32802045be3d9dc27 to your computer and use it in GitHub Desktop.
What could possibly go wrong?
module Equality
def ==(other)
return false unless other.is_a?(self.class)
instance_variables.all? do |ivar|
instance_variable_get(ivar) == other.instance_variable_get(ivar)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment