Module: MyRepresentatives::Hashable
- Included in:
- Electorate, Person
- Defined in:
- lib/my_representatives/hashable.rb
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
4 5 6 7 8 |
# File 'lib/my_representatives/hashable.rb', line 4 def to_hash hash = {} instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) } hash end |