Class: LedgerSync::Adaptors::QuickBooksOnline::Account::Searcher

Inherits:
Searcher
  • Object
show all
Defined in:
lib/ledger_sync/adaptors/quickbooks_online/account/searcher.rb

Instance Attribute Summary

Attributes inherited from Searcher

#adaptor, #pagination, #query

Instance Method Summary collapse

Methods inherited from Searcher

#next_searcher, #previous_searcher, #search

Methods inherited from Searcher

#initialize, #next_searcher, #previous_searcher, #search

Constructor Details

This class inherits a constructor from LedgerSync::Adaptors::Searcher

Instance Method Details

#resourcesObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ledger_sync/adaptors/quickbooks_online/account/searcher.rb', line 8

def resources
  @resources ||= begin
    adaptor
      .query(
        resource: 'account',
        query: "Name LIKE '%#{query}%'",
        limit: limit,
        offset: offset
      )
      .map do |c|
        LedgerSerializer.new(resource: LedgerSync::.new).deserialize(hash: c)
      end
  end
end