Class: ShipHero::Services::ProductService
- Inherits:
-
BaseService
- Object
- BaseService
- ShipHero::Services::ProductService
- Defined in:
- lib/ship_hero/services/product_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
Instance Method Summary collapse
- #create_product(product) ⇒ Object
- #get_products(request = ShipHero::Requests::GetProduct.new) ⇒ Object
Methods inherited from BaseService
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 |