Module: Hdo::StortingImporter::IvarEquality

Instance Method Summary collapse

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

#hashObject



10
11
12
# File 'lib/hdo/storting_importer/ivar_equality.rb', line 10

def hash
  __ivars__.hash ^ self.class.hash
end