Sha256: ff5afa49b23323756e860224f7a7d50e430f4b31e1c4afae7f0125756529260f

Contents?: true

Size: 825 Bytes

Versions: 10

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

require_relative '../reference/deserializer'

module LedgerSync
  module QuickBooksOnline
    class DepositLineDetail
      class Deserializer < QuickBooksOnline::Deserializer
        references_one :Account,
                       hash_attribute: 'AccountRef',
                       deserializer: Reference::Deserializer

        references_one :Class,
                       hash_attribute: 'ClassRef',
                       deserializer: Reference::Deserializer

        attribute(:Entity) do |args = {}|
          hash = args.fetch(:hash)
          value = hash.fetch('Entity', nil)

          unless value.nil?
            Customer.new(
              ledger_id: value['value'],
              DisplayName: value['name']
            )
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ledger_sync-quickbooks_online-2.0.0 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-1.0.1 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-1.0.0 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.4.0 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.3.1 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.3.0 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.2.6 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.2.5 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.2.4 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb
ledger_sync-quickbooks_online-0.2.2 lib/ledger_sync/quickbooks_online/deposit_line_detail/deserializer.rb