Module: Zuora::Serializers::Attribute

Defined in:
lib/zuora/serializers/attribute.rb

Class Method Summary collapse

Class Method Details

.serialize(model) ⇒ Object

Parameters:

  • model: (Object)

    An object responding to .attributes for which each attr can be .send(attr)

  • { (Hash)

    [String]: lowerCamelCased key => [Any]: value }



8
9
10
11
12
# File 'lib/zuora/serializers/attribute.rb', line 8

def self.serialize(model)
  attrs = model.attributes
  attr_pairs =  attrs.map { |attr| serialize_attr model, attr }
  Hash[attr_pairs]
end