Class: ShipHero::Services::ProductService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/ship_hero/services/product_service.rb

Instance Attribute Summary

Attributes inherited from BaseService

#api_key

Instance Method Summary collapse

Methods inherited from BaseService

#initialize

Constructor Details

This class inherits a constructor from ShipHero::Services::BaseService

Instance Method Details

#create_product(product) ⇒ Object



15
16
17
18
# File 'lib/ship_hero/services/product_service.rb', line 15

def create_product(product)
  raise Exceptions::ServiceException, "Must be a ShipHero::Product" unless product.is_a?(ShipHero::Product)
  post(Util::Config.get('endpoints.create_product'), [product])
end

#get_products(request = ShipHero::Requests::GetProduct.new) ⇒ Object



10
11
12
13
# File 'lib/ship_hero/services/product_service.rb', line 10

def get_products(request = ShipHero::Requests::GetProduct.new)
  raise Exceptions::ServiceException, "Must be a ShipHero::Requests::GetProduct" unless request.is_a?(ShipHero::Requests::GetProduct)
  get(Util::Config.get('endpoints.get_products'), request)
end