Class: Uber::Request

Inherits:
Base
  • Object
show all
Defined in:
lib/uber/models/request.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize

Constructor Details

This class inherits a constructor from Uber::Base

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def destination
  @destination
end

#driverObject

Returns the value of attribute driver.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def driver
  @driver
end

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def errors
  @errors
end

#etaObject

Returns the value of attribute eta.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def eta
  @eta
end

#locationObject

Returns the value of attribute location.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def location
  @location
end

#metaObject

Returns the value of attribute meta.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def meta
  @meta
end

#pickupObject

Returns the value of attribute pickup.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def pickup
  @pickup
end

#request_idObject

Returns the value of attribute request_id.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def request_id
  @request_id
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def status
  @status
end

#surge_multiplierObject

Returns the value of attribute surge_multiplier.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def surge_multiplier
  @surge_multiplier
end

#vehicleObject

Returns the value of attribute vehicle.



3
4
5
# File 'lib/uber/models/request.rb', line 3

def vehicle
  @vehicle
end

Instance Method Details

#driver_image_urlObject



38
39
40
# File 'lib/uber/models/request.rb', line 38

def driver_image_url
  driver.nil? ? nil : "#{driver.picture_url}"
end

#humanized_etaObject



42
43
44
45
46
# File 'lib/uber/models/request.rb', line 42

def humanized_eta
  unless eta.nil?
    eta.to_i == 1 ? "#{eta} minute" : "#{eta} minutes"
  end
end

#vehicle_image_urlObject



34
35
36
# File 'lib/uber/models/request.rb', line 34

def vehicle_image_url
  vehicle.nil? ? nil : "#{vehicle.picture_url}"
end

#vehicle_nameObject



30
31
32
# File 'lib/uber/models/request.rb', line 30

def vehicle_name
  vehicle.nil? ? nil : "#{vehicle.make} #{vehicle.model}"
end