class Uber::ApiRequest
Attributes
client[RW]
options[RW]
path[RW]
request_method[RW]
verb[RW]
Public Class Methods
new(client, request_method, path, options = {})
click to toggle source
@param client [Uber::Client] @param request_method
[String, Symbol] @param path [String] @param options [Hash] @return [Uber::ApiRequest]
# File lib/uber/api_request.rb, line 12 def initialize(client, request_method, path, options = {}) @client = client @request_method = request_method.to_sym @path = path @options = options end
Public Instance Methods
perform()
click to toggle source
@return [Hash]
# File lib/uber/api_request.rb, line 20 def perform @client.send(@request_method, @path, @options).body end
perform_with_object(klass)
click to toggle source
@param klass [Class] @param request [Uber::ApiRequest] @return [Object]
# File lib/uber/api_request.rb, line 27 def perform_with_object(klass) klass.new(perform) end
perform_with_objects(klass)
click to toggle source
@param klass [Class] @return [Array]
# File lib/uber/api_request.rb, line 33 def perform_with_objects(klass) perform.values.flatten.map do |element| klass.new(element) end end