Class: Postmates::Delivery
- Inherits:
-
Object
- Object
- Postmates::Delivery
- Includes:
- Utils
- Defined in:
- lib/postmates/delivery.rb
Instance Attribute Summary collapse
-
#complete ⇒ Object
readonly
Returns the value of attribute complete.
-
#courier ⇒ Object
readonly
Returns the value of attribute courier.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#dropoff ⇒ Object
readonly
Returns the value of attribute dropoff.
-
#dropoff_deadline ⇒ Object
readonly
Returns the value of attribute dropoff_deadline.
-
#dropoff_eta ⇒ Object
readonly
Returns the value of attribute dropoff_eta.
-
#fee ⇒ Object
readonly
Returns the value of attribute fee.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_url ⇒ Object
readonly
Returns the value of attribute image_url.
-
#manifest ⇒ Object
readonly
Returns the value of attribute manifest.
-
#pickup ⇒ Object
readonly
Returns the value of attribute pickup.
-
#pickup_eta ⇒ Object
readonly
Returns the value of attribute pickup_eta.
-
#quote_id ⇒ Object
readonly
Returns the value of attribute quote_id.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
- #delivered? ⇒ Boolean
-
#initialize(hash) ⇒ Delivery
constructor
A new instance of Delivery.
Methods included from Utils
Constructor Details
#initialize(hash) ⇒ Delivery
Returns a new instance of Delivery.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/postmates/delivery.rb', line 11 def initialize(hash) @id = hash['id'] @status = hash['status'] @complete = hash['complete'] @quote_id = hash['quote_id'] @fee = hash['fee'] @currency = hash['currency'] @manifest = hash['manifest'] @pickup = hash['pickup'] @dropoff = hash['dropoff'] @courier = hash['courier'] @image_url = urlify hash['image_href'] @created_at = timeify hash['created'] @updated_at = timeify hash['updated'] @pickup_eta = timeify hash['pickup_eta'] @dropoff_eta = timeify hash['dropoff_eta'] end |
Instance Attribute Details
#complete ⇒ Object (readonly)
Returns the value of attribute complete.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def complete @complete end |
#courier ⇒ Object (readonly)
Returns the value of attribute courier.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def courier @courier end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def currency @currency end |
#dropoff ⇒ Object (readonly)
Returns the value of attribute dropoff.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def dropoff @dropoff end |
#dropoff_deadline ⇒ Object (readonly)
Returns the value of attribute dropoff_deadline.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def dropoff_deadline @dropoff_deadline end |
#dropoff_eta ⇒ Object (readonly)
Returns the value of attribute dropoff_eta.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def dropoff_eta @dropoff_eta end |
#fee ⇒ Object (readonly)
Returns the value of attribute fee.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def fee @fee end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def id @id end |
#image_url ⇒ Object (readonly)
Returns the value of attribute image_url.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def image_url @image_url end |
#manifest ⇒ Object (readonly)
Returns the value of attribute manifest.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def manifest @manifest end |
#pickup ⇒ Object (readonly)
Returns the value of attribute pickup.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def pickup @pickup end |
#pickup_eta ⇒ Object (readonly)
Returns the value of attribute pickup_eta.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def pickup_eta @pickup_eta end |
#quote_id ⇒ Object (readonly)
Returns the value of attribute quote_id.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def quote_id @quote_id end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def status @status end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
6 7 8 |
# File 'lib/postmates/delivery.rb', line 6 def updated_at @updated_at end |
Instance Method Details
#delivered? ⇒ Boolean
29 30 31 |
# File 'lib/postmates/delivery.rb', line 29 def delivered? status == 'delivered' end |