Sha256: 4caaa94d09023c6e0b9ae25c95fa64e9afc37ce8be186acc750f2a66a8801709

Contents?: true

Size: 594 Bytes

Versions: 1

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true

require_relative 'attribute_set_mixin'

module LedgerSync
  class 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

1 entries across 1 versions & 1 rubygems

Version Path
ledger_sync-1.3.5 lib/ledger_sync/serialization/deserializer_attribute_set.rb