Class: LedgerSync::Serialization::DeserializerAttributeSet
- Inherits:
-
Object
- Object
- LedgerSync::Serialization::DeserializerAttributeSet
- Includes:
- AttributeSetMixin
- Defined in:
- lib/ledger_sync/serialization/deserializer_attribute_set.rb
Instance Attribute Summary
Attributes included from AttributeSetMixin
#attributes, #serializer_class
Instance Method Summary collapse
Methods included from AttributeSetMixin
Methods included from Util::Mixins::DelegateIterableMethodsMixin
Instance Method Details
#add(attribute) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ledger_sync/serialization/deserializer_attribute_set.rb', line 10 def add(attribute) raise 'resource_attribute is missing' unless attribute.resource_attribute.present? if attributes.key?(attribute.resource_attribute.to_s) raise "resource_attribute already defined for #{serializer_class.name}: #{attribute.resource_attribute}" end @attributes[attribute.resource_attribute] = attribute attribute end |