Sha256: f77a022ff775d343046750337191591a1ff734591dad259c93e4e6024c1a3c6f

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

module LedgerSync
  module Adaptors
    module QuickBooksOnline
      module Customer
        class Searcher < LedgerSync::Adaptors::QuickBooksOnline::Searcher
          def resources
            @resources ||= begin
              adaptor
                .query(
                  resource: 'customer',
                  query: "DisplayName LIKE '%#{query}%'",
                  limit: limit,
                  offset: offset
                )
                .map do |c|
                  LedgerSync::Customer.new(
                    ledger_id: c.fetch('Id'),
                    name: c.dig('FullyQualifiedName')
                  )
                end
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ledger_sync-1.1.3 lib/ledger_sync/adaptors/quickbooks_online/customer/searcher.rb
ledger_sync-1.1.2 lib/ledger_sync/adaptors/quickbooks_online/customer/searcher.rb
ledger_sync-1.1.1 lib/ledger_sync/adaptors/quickbooks_online/customer/searcher.rb