class SynapsePayRest::Atms

Wrapper class for /client endpoint

Constants

VALID_QUERY_PARAMS

Attributes

client[RW]

@!attribute [rw] client

@return [SynapsePayRest::HTTPClient]

Public Class Methods

new(client) click to toggle source

@param client [SynapsePayRest::HTTPClient]

# File lib/synapse_pay_rest/api/atms.rb, line 11
def initialize(client)
  @client = client
end

Public Instance Methods

locate(**options) click to toggle source

Sends a GET request to /nodes endpoint to locate atms, and returns the response.

@param scope [String]

@raise [SynapsePayRest::Error] may return subclasses of error based on HTTP response from API

@return [Hash] API responsea

# File lib/synapse_pay_rest/api/atms.rb, line 24
def locate(**options)
  params = VALID_QUERY_PARAMS.map do |p|
    options[p] ? "#{p}=#{options[p]}" : nil
  end.compact

  path = "/nodes/atms?"
  path += params.join('&') if params.any?
  client.get(path)
end