class OwApi::Client

Constants

BASE_URL

Private Instance Methods

get(path) click to toggle source
# File lib/ow_api/client.rb, line 15
def get(path)
  URI.parse("#{BASE_URL}/v1/#{path}").read
end
handle_response(response, klass) click to toggle source
# File lib/ow_api/client.rb, line 19
def handle_response(response, klass)
  json_response = JSON.parse(response)
  snake_case_response = Interactors::HashKeysToSnakeCase.new.call(json_response)
  klass.new(snake_case_response)
end