Module: FatZebra::APIOperation::Search

Included in:
BankAccount, Batch, Customer, DirectCredit, DirectDebit, Purchase, Refund, WebHook
Defined in:
lib/fat_zebra/api_operation/search.rb

Overview

Search resources for the API

Constant Summary collapse

DEFAULT_PARAMS =

Default params for the API

{
  offets: 0,
  limit: 10
}.freeze

Instance Method Summary collapse

Instance Method Details

#search(params = {}, options = {}) ⇒ FatZebra::Object

Search for API Resources

Parameters:

  • params (Hash) (defaults to: {})

    for the request

  • Additional (Hash)

    options for the request

Returns:

  • (FatZebra::Object)

    response from the API



22
23
24
25
26
27
28
# File 'lib/fat_zebra/api_operation/search.rb', line 22

def search(params = {}, options = {})
  params = DEFAULT_PARAMS.merge(params)
  params = Util.format_dates_in_hash(params)

  response = request(:get, resource_path, params, options)
  initialize_from(response)
end