Sha256: 491dd6bf390cacf5e4f5c096a192528b19dd8ed479584148eac3aaa5cb862f79

Contents?: true

Size: 595 Bytes

Versions: 23

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

require_relative 'attribute_set_mixin'

module LedgerSync
  module Serialization
    class DeserializerAttributeSet
      include AttributeSetMixin

      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
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ledger_sync-3.0.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.6.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.5.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.4.4 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.3.1 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.2.3 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.2.1 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.2.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.0.2 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.0.1 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.0.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-2.0.0.pre.1 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.8.1 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.8.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.7.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.6.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.5.2 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.5.1 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.5.0 lib/ledger_sync/serialization/deserializer_attribute_set.rb
ledger_sync-1.4.4 lib/ledger_sync/serialization/deserializer_attribute_set.rb