class Delivery::Client

Attributes

base_uri[RW]
client_id[RW]

Public Class Methods

new(client_id, options={}) click to toggle source
# File lib/delivery/client.rb, line 11
def initialize(client_id, options={})
  @client_id = client_id

  options[:base_uri] ||= 'https://api.delivery.com'
  @base_uri = options[:base_uri]
end

Public Instance Methods

hours(id, options={}) click to toggle source
# File lib/delivery/client.rb, line 39
def hours(id, options={})
  options = {query: {client_id: client_id}.merge(options)}
  response = self.class.get("#{base_uri}/merchant/#{id}/hours", options)
  Hashie::Mash.new(JSON.parse(response.body))
end
Also aliased as: merchant_hours
info(id, options={}) click to toggle source
# File lib/delivery/client.rb, line 25
def info(id, options={})
  options = {query: {client_id: client_id}.merge(options)}
  response = self.class.get("#{base_uri}/merchant/#{id}", options)
  Hashie::Mash.new(JSON.parse(response.body))
end
Also aliased as: merchant_info
menu(id, options={}) click to toggle source
Also aliased as: merchant_menu
merchant_hours(id, options={})
Alias for: hours
merchant_info(id, options={})
Alias for: info
merchant_menu(id, options={})
Alias for: menu