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

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

Instance Attribute Summary

Attributes inherited from Searcher

#adaptor, #pagination, #query, #resources

Instance Method Summary collapse

Methods inherited from Searcher

#initialize

Constructor Details

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

Instance Method Details

#next_searcherObject



7
8
9
# File 'lib/ledger_sync/adaptors/quickbooks_online/searcher.rb', line 7

def next_searcher
  paginate(limit: limit, offset: offset + limit)
end

#previous_searcherObject



11
12
13
14
15
# File 'lib/ledger_sync/adaptors/quickbooks_online/searcher.rb', line 11

def previous_searcher
  return nil if offset <= 1

  paginate(limit: limit, offset: offset - limit)
end

#searchObject



17
18
19
20
21
22
# File 'lib/ledger_sync/adaptors/quickbooks_online/searcher.rb', line 17

def search
  super
rescue OAuth2::Error => e
  @response = e # TODO: Better catch/raise errors as LedgerSync::Error
  failure
end