Module: Hdo::StortingImporter::IvarEquality
- Included in:
- Category, Committee, CommitteeMembership, District, ParliamentIssue, ParliamentIssueDetails, ParliamentPeriod, ParliamentSession, Party, PartyMembership, Promise, Proposition, Representative, Vote
- Defined in:
- lib/hdo/storting_importer/ivar_equality.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #__ivars__ ⇒ Object
- #hash ⇒ Object
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
5 6 7 |
# File 'lib/hdo/storting_importer/ivar_equality.rb', line 5 def ==(other) other.kind_of?(self.class) && __ivars__ == other.__ivars__ end |
#__ivars__ ⇒ Object
14 15 16 17 18 19 |
# File 'lib/hdo/storting_importer/ivar_equality.rb', line 14 def __ivars__ res = {} instance_variables.each { |e| res[e] = instance_variable_get(e) } res end |
#hash ⇒ Object
10 11 12 |
# File 'lib/hdo/storting_importer/ivar_equality.rb', line 10 def hash __ivars__.hash ^ self.class.hash end |