Class: ShipHero::Services::ShipmentService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/ship_hero/services/shipment_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_shipment(shipment) ⇒ Object



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

def create_shipment(shipment)
  raise Exceptions::ServiceException, "Must be a ShipHero::Shipment" unless shipment.is_a?(ShipHero::Shipment)
  post(Util::Config.get('endpoints.create_shipment'), shipment)
end

#get_shipments(request = ShipHero::Requests::GetShipment.new) ⇒ Object



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

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