class Postmates::Client

Public Class Methods

new() click to toggle source
# File lib/postmates/client.rb, line 11
def initialize
  reset
end

Public Instance Methods

cancel(delivery_id) click to toggle source

POST /v1/customers/:customer_id/deliveries/:delivery_id/cancel

Returns a Delivery object or the raw Faraday response if raw_response = true

# File lib/postmates/client.rb, line 69
def cancel(delivery_id)
  post("customers/#{customer_id}/deliveries/#{delivery_id}/cancel")
end
create(options = {}) click to toggle source

POST /v1/customers/:customer_id/deliveries

manifest=“a box of kittens” pickup_name=“The Warehouse” pickup_address=“20 McAllister St, San Francisco, CA” pickup_phone_number=“555-555-5555” pickup_business_name=“Optional Pickup Business Name, Inc.” pickup_notes=“Optional note that this is Invoice #123” dropoff_name=“Alice” dropoff_address=“101 Market St, San Francisco, CA” dropoff_phone_number=“415-555-1234” dropoff_business_name=“Optional Dropoff Business Name, Inc.” dropoff_notes=“Optional note to ring the bell” quote_id=qUdje83jhdk

Returns a Delivery object or the raw Faraday response if raw_response = true

# File lib/postmates/client.rb, line 43
def create(options = {})
  post("customers/#{customer_id}/deliveries", options)
end
list(options = {}) click to toggle source

GET /v1/customers/:customer_id/deliveries

?filter=ongoing

Returns a list of Delivery objects or the raw Faraday response if raw_response = true

# File lib/postmates/client.rb, line 53
def list(options = {})
  get("customers/#{customer_id}/deliveries", options)
end
quote(options = {}) click to toggle source

POST /v1/customers/:customer_id/delivery_quotes

pickup_address=“20 McAllister St, San Francisco, CA” dropoff_address=“101 Market St, San Francisco, CA”

Returns a Quote object or the raw Faraday response if raw_response = true

# File lib/postmates/client.rb, line 22
def quote(options = {})
  post("customers/#{customer_id}/delivery_quotes", options)
end
retrieve(delivery_id) click to toggle source

GET /v1/customers/:customer_id/deliveries/:delivery_id

Returns a Delivery object or the raw Faraday response if raw_response = true

# File lib/postmates/client.rb, line 61
def retrieve(delivery_id)
  get("customers/#{customer_id}/deliveries/#{delivery_id}")
end
return(delivery_id) click to toggle source

POST /v1/customers/:customer_id/deliveries/:delivery_id/return

Returns a Delivery object or the raw Faraday response if raw_response = true

# File lib/postmates/client.rb, line 77
def return(delivery_id)
  post("customers/#{customer_id}/deliveries/#{delivery_id}/return")
end