Class: LedgerSync::Adaptors::Test::Account::Searcher
- Inherits:
-
Searcher
- Object
- Searcher
- LedgerSync::Adaptors::Test::Account::Searcher
show all
- Defined in:
- lib/ledger_sync/adaptors/test/account/searcher.rb
Instance Attribute Summary
Attributes inherited from Searcher
#adaptor, #pagination, #query
Instance Method Summary
collapse
Methods inherited from Searcher
#initialize
Instance Method Details
#next_searcher ⇒ Object
6
7
8
|
# File 'lib/ledger_sync/adaptors/test/account/searcher.rb', line 6
def next_searcher
paginate(cursor: 'asdf')
end
|
#previous_searcher ⇒ Object
10
11
12
|
# File 'lib/ledger_sync/adaptors/test/account/searcher.rb', line 10
def previous_searcher
paginate(cursor: 'asdf')
end
|
#resources ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/ledger_sync/adaptors/test/account/searcher.rb', line 14
def resources
@resources ||= begin
adaptor
.query(
resource: 'account',
query: "name LIKE '#{query}%'"
)
.map do |a|
LedgerSync::Account.new(
ledger_id: a.fetch('id'),
name: a.fetch('name', ''),
account_type: a.fetch('account_type', '')
)
end
end
end
|
#search ⇒ Object
31
32
33
34
35
|
# File 'lib/ledger_sync/adaptors/test/account/searcher.rb', line 31
def search
super
rescue OAuth2::Error => e
failure(e)
end
|