Module: Hashable
Constant Summary collapse
- VERSION =
'0.1.2'
Instance Method Summary collapse
-
#to_deep_hash ⇒ Object
(also: #to_dh)
Return recursively hash representation of the object.
Instance Method Details
#to_deep_hash ⇒ Object Also known as: to_dh
Return recursively hash representation of the object
5 6 7 8 9 10 11 |
# File 'lib/hashable/hashable.rb', line 5 def to_deep_hash hash = {} instance_variables.each do |key| hash[key[1..-1].to_sym] = deeply_to_hash(instance_variable_get(key)) end hash end |