Module: ToHash
- Defined in:
- lib/bloc/to_hash.rb
Instance Method Summary collapse
Instance Method Details
#to_h ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/bloc/to_hash.rb', line 2 def to_h hash = {} self.instance_variables.each do |var| hash[var.to_s.delete("@")] = self.instance_variable_get(var) end hash end |