Module: LedgerSync::Serialization::AttributeSetMixin

Includes:
Util::Mixins::DelegateIterableMethodsMixin
Included in:
DeserializerAttributeSet, SerializerAttributeSet
Defined in:
lib/ledger_sync/serialization/attribute_set_mixin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Mixins::DelegateIterableMethodsMixin

included

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



8
9
10
# File 'lib/ledger_sync/serialization/attribute_set_mixin.rb', line 8

def attributes
  @attributes
end

#serializer_classObject (readonly)

Returns the value of attribute serializer_class.



8
9
10
# File 'lib/ledger_sync/serialization/attribute_set_mixin.rb', line 8

def serializer_class
  @serializer_class
end

Instance Method Details

#add(_attribute) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/ledger_sync/serialization/attribute_set_mixin.rb', line 18

def add(_attribute)
  raise NotImplementedError
end

#hash_attribute?(key) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/ledger_sync/serialization/attribute_set_mixin.rb', line 22

def hash_attribute?(key)
  hash_attribute_keyed_hash.include?(key.to_s)
end

#initialize(args = {}) ⇒ Object



13
14
15
16
# File 'lib/ledger_sync/serialization/attribute_set_mixin.rb', line 13

def initialize(args = {})
  @attributes       = {}
  @serializer_class = args.fetch(:serializer_class)
end