Class: Uber::Request
Instance Attribute Summary collapse
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#eta ⇒ Object
Returns the value of attribute eta.
-
#location ⇒ Object
Returns the value of attribute location.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#request_id ⇒ Object
Returns the value of attribute request_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#surge_multiplier ⇒ Object
Returns the value of attribute surge_multiplier.
-
#vehicle ⇒ Object
Returns the value of attribute vehicle.
Attributes inherited from Base
Instance Method Summary collapse
- #driver_image_url ⇒ Object
- #errors? ⇒ Boolean
- #humanized_eta ⇒ Object
- #vehicle_image_url ⇒ Object
- #vehicle_name ⇒ Object
Methods inherited from Base
Constructor Details
This class inherits a constructor from Uber::Base
Instance Attribute Details
#driver ⇒ Object
Returns the value of attribute driver.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def driver @driver end |
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def errors @errors end |
#eta ⇒ Object
Returns the value of attribute eta.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def eta @eta end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def location @location end |
#meta ⇒ Object
Returns the value of attribute meta.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def end |
#product_id ⇒ Object
Returns the value of attribute product_id.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def product_id @product_id end |
#request_id ⇒ Object
Returns the value of attribute request_id.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def request_id @request_id end |
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def status @status end |
#surge_multiplier ⇒ Object
Returns the value of attribute surge_multiplier.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def surge_multiplier @surge_multiplier end |
#vehicle ⇒ Object
Returns the value of attribute vehicle.
4 5 6 |
# File 'lib/uber/models/request.rb', line 4 def vehicle @vehicle end |
Instance Method Details
#driver_image_url ⇒ Object
43 44 45 |
# File 'lib/uber/models/request.rb', line 43 def driver_image_url driver.nil? ? nil : driver.picture_url.to_s end |
#errors? ⇒ Boolean
31 32 33 |
# File 'lib/uber/models/request.rb', line 31 def errors? @errors && @errors.size >= 1 end |
#humanized_eta ⇒ Object
47 48 49 |
# File 'lib/uber/models/request.rb', line 47 def humanized_eta !eta.nil? && eta.to_i == 1 ? "#{eta} minute" : "#{eta} minutes" end |
#vehicle_image_url ⇒ Object
39 40 41 |
# File 'lib/uber/models/request.rb', line 39 def vehicle_image_url vehicle.nil? ? nil : vehicle.picture_url.to_s end |
#vehicle_name ⇒ Object
35 36 37 |
# File 'lib/uber/models/request.rb', line 35 def vehicle_name vehicle.nil? ? nil : "#{vehicle.make} #{vehicle.model}" end |