Method: Postmates::Delivery#initialize

Defined in:
lib/postmates/delivery.rb

#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