class FedgerAPI::Client

Class provide connection to fedger.io api

Attributes

api_key[R]
options[R]

Public Class Methods

new(api_key = nil) click to toggle source
# File lib/fedger_api/client.rb, line 26
def initialize(api_key = nil)
  @api_key ||= api_key || ENV['FEDGER_API_KEY']
  @options = { query: { apikey: @api_key }, verify: false }
end

Protected Instance Methods

create_response(http_response) click to toggle source
# File lib/fedger_api/client.rb, line 37
def create_response(http_response)
  response.new(http_response)
end
merge_options(query = nil) click to toggle source
# File lib/fedger_api/client.rb, line 41
def merge_options(query = nil)
  return options unless query
  options.merge(query: options[:query].merge(query))
end
response() click to toggle source
# File lib/fedger_api/client.rb, line 33
def response
  @response ||= Response
end