Class: LedgerSync::Adaptors::NetSuite::Account::Searcher

Inherits:
Searcher show all
Defined in:
lib/ledger_sync/adaptors/netsuite/account/searcher.rb

Instance Attribute Summary

Attributes inherited from Searcher

#adaptor, #pagination, #query, #request

Instance Method Summary collapse

Methods included from Mixins::OffsetAndLimitPaginationSearcherMixin

#next_searcher, #previous_searcher

Methods inherited from Searcher

#initialize, #next_searcher, #previous_searcher, #search

Methods included from Mixins::InferLedgerSerializerMixin

included

Methods included from Mixins::InferResourceClassMixin

included

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
22
23
# File 'lib/ledger_sync/adaptors/netsuite/account/searcher.rb', line 8

def resources
  @resources ||= begin
    @request = adaptor
      .get(
        path: "/record/account?limit=#{limit}&offset=#{offset}"
      )

    request.body
      .fetch('items')
      .map do |c|
        LedgerDeserializer.new(
          resource: LedgerSync::Account.new
        ).deserialize(hash: c)
      end
  end
end