Module: Objectmancy::Hashable

Defined in:
lib/objectmancy/hashable.rb

Overview

Mixin for allowing your object to be converted into a Hash.

Instance Method Summary collapse

Instance Method Details

#hashifyHash

Turns the object into a Hash according to the rules defined with


37
38
39
40
41
# File 'lib/objectmancy/hashable.rb', line 37

def hashify
  _present_hashable_values.each_with_object({}) do |(attr, options), memo|
    memo[attr] = _hashify_value(send(attr), options)
  end
end