class Uber::Estimates::Request

Constants

URLS

Attributes

header[R]
params[R]
type[R]

Public Class Methods

new(type, params) click to toggle source
# File lib/uber/estimates/request.rb, line 8
def initialize(type, params)
  @type = type
  @params = params
  @header = {Authorization: %Q[Token #{::Uber::Estimates.configuration.server_token}] }
end

Public Instance Methods

response() click to toggle source
# File lib/uber/estimates/request.rb, line 14
def response
  Response.new(type, raw_response)
end

Private Instance Methods

raw_response() click to toggle source
# File lib/uber/estimates/request.rb, line 20
def raw_response
  begin
    RestClient::Request.execute(method: :get, url: URLS[type], payload: params, headers: header)
  rescue Exception => e
    raise BadRequestException.new('Something went wrong on request. Please check params')
  end
end