Module: Accession::Equality
Overview
rubocop:todo Style/Documentation
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
Two objects are comparable if all of their instance variables that are present are comparable.
- #to_a ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
Two objects are comparable if all of their instance variables that are present are comparable.
38 39 40 41 42 |
# File 'lib/accession/accession.rb', line 38 def <=>(other) return unless other.is_a?(self.class) to_a <=> other.to_a end |
#to_a ⇒ Object
31 32 33 |
# File 'lib/accession/accession.rb', line 31 def to_a attributes.collect { |v| instance_variable_get("@#{v}") }.compact end |