Sha256: 9ac2b577d7f91d022aa4506b3b131c98312e5c81b19a127dacb78bc75a5fffd3
Contents?: true
Size: 860 Bytes
Versions: 8
Compression:
Stored size: 860 Bytes
Contents
# frozen_string_literal: true module LedgerSync module Ledgers module QuickBooksOnline module Serialization module Type class DeserializeTransactionReferenceType < LedgerSync::Type::Value def cast_value(value:) return if value.nil? raise "Unknown value type. Array expected. Given: #{value.class.name}" unless value.is_a?(Array) return if value.empty? value.map do |item| resource_class = Client.resource_from_ledger_type(type: item['TxnType']) raise "Unknown QuickBooks Online resource type: #{item['TxnType']}" if resource_class.blank? resource_class.new( ledger_id: item['TxnId'] ) end end end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems