Method: Representable::Hash::HashBinding#serialize_for

Defined in:
lib/representable/bindings/hash_bindings.rb

#serialize_for(value) ⇒ Object



57
58
59
60
61
62
# File 'lib/representable/bindings/hash_bindings.rb', line 57

def serialize_for(value)
  # requires value to respond to #each with two block parameters.
  {}.tap do |hash|
    value.each { |key, obj| hash[key] = serialize(obj) }
  end
end