Sha256: 218e119e71c294934070bd3361b7e800860cb645c2ede147a2ba00cfb2c0c72a

Contents?: true

Size: 605 Bytes

Versions: 15

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module NetSuite
    class Type
      class DeserializerSubsidiaryType < LedgerSync::Type::Value
        def initialize(args = {})
          @subsidiary_class = args.fetch(:subsidiary_class)

          super()
        end

        private

        def cast_value(args = {})
          value = args.fetch(:value)

          return if value.nil?

          @subsidiary_class.new(
            ledger_id: value.fetch('id', nil)
          )
        end

        def valid_classes
          [
            Hash
          ]
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ledger_sync-netsuite-0.7.1 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.6.2 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.6.1 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.6.0 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.5.0 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.4.2 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.6 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.5 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.4 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.3 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.2 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.1 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.3.0 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.2.0 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb
ledger_sync-netsuite-0.1.1 lib/ledger_sync/netsuite/type/deserializer_subsidiary_type.rb