Module: Accession::Equality
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.
42 43 44 45 46 |
# File 'lib/accession.rb', line 42 def <=>(other) return unless other.is_a?(self.class) to_a <=> other.to_a end |
#to_a ⇒ Object
35 36 37 |
# File 'lib/accession.rb', line 35 def to_a attributes.filter_map { |v| instance_variable_get("@#{v}") } end |