Class: ShipHero::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/ship_hero/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Api

Returns a new instance of Api.



11
12
13
# File 'lib/ship_hero/api.rb', line 11

def initialize(api_key)
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



9
10
11
# File 'lib/ship_hero/api.rb', line 9

def api_key
  @api_key
end

Instance Method Details

#create_order(request) ⇒ Object



30
31
32
# File 'lib/ship_hero/api.rb', line 30

def create_order(request)
  ShipHero::Services::OrderService.new(@api_key).create_order(request)
end

#create_order_historye(request) ⇒ Object



36
37
38
# File 'lib/ship_hero/api.rb', line 36

def create_order_historye(request)
  ShipHero::Services::OrderService.new(@api_key).create_order_historye(request)
end

#create_product(request) ⇒ Object



19
20
21
# File 'lib/ship_hero/api.rb', line 19

def create_product(request)
  ShipHero::Services::ProductService.new(@api_key).create_product(request)
end

#create_shipment(request) ⇒ Object



44
45
46
# File 'lib/ship_hero/api.rb', line 44

def create_shipment(request)
  ShipHero::Services::ShipmentService.new(@api_key).create_shipment(request)
end

#get_order(request) ⇒ Object



27
28
29
# File 'lib/ship_hero/api.rb', line 27

def get_order(request)
  ShipHero::Services::OrderService.new(@api_key).get_order(request)
end

#get_orders(request) ⇒ Object

Order Services



24
25
26
# File 'lib/ship_hero/api.rb', line 24

def get_orders(request)
  ShipHero::Services::OrderService.new(@api_key).get_orders(request)
end

#get_products(request) ⇒ Object

Product Services



16
17
18
# File 'lib/ship_hero/api.rb', line 16

def get_products(request)
  ShipHero::Services::ProductService.new(@api_key).get_products(request)
end

#get_shipments(request) ⇒ Object

Shipment Services



41
42
43
# File 'lib/ship_hero/api.rb', line 41

def get_shipments(request)
  ShipHero::Services::ShipmentService.new(@api_key).get_shipments(request)
end

#get_webhooksObject

Webhook Services



49
50
51
# File 'lib/ship_hero/api.rb', line 49

def get_webhooks
  ShipHero::Services::WebhookService.new(@api_key).get_webhooks
end

#register_webhook(request) ⇒ Object



52
53
54
# File 'lib/ship_hero/api.rb', line 52

def register_webhook(request)
  ShipHero::Services::WebhookService.new(@api_key).register_webhook(request)
end

#unregister_webhook(request) ⇒ Object



55
56
57
# File 'lib/ship_hero/api.rb', line 55

def unregister_webhook(request)
  ShipHero::Services::WebhookService.new(@api_key).unregister_webhook(request)
end

#update_order(request) ⇒ Object



33
34
35
# File 'lib/ship_hero/api.rb', line 33

def update_order(request)
  ShipHero::Services::OrderService.new(@api_key).update_order(request)
end