Skip to content

Instantly share code, notes, and snippets.

@tatey tatey/equality.rb
Created Aug 2, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.