class EasyBroker::Query

Attributes

api_client[R]
endpoint[R]
query_params[R]

Public Class Methods

new(api_client, endpoint, query_params) click to toggle source
# File lib/easy_broker/query.rb, line 6
def initialize(api_client, endpoint, query_params)
  @api_client = api_client
  @endpoint = endpoint
  @query_params = query_params
end

Public Instance Methods

get(page = 1) click to toggle source
# File lib/easy_broker/query.rb, line 12
def get(page = 1)
  query_params[:page] = page
  response = api_client.get(endpoint, query: query_params)
  JSON.parse(response.body, object_class: OpenStruct)
end