Class: ShipEngine::Domain::Tracking
- Inherits:
-
Object
- Object
- ShipEngine::Domain::Tracking
- Defined in:
- lib/shipengine/domains/tracking.rb
Instance Method Summary collapse
-
#initialize ⇒ Tracking
constructor
A new instance of Tracking.
- #start_tracking_package(params: {}) ⇒ Object
- #stop_tracking_package(params: {}) ⇒ Object
- #tracking_information(params: {}) ⇒ Object
Constructor Details
#initialize ⇒ Tracking
Returns a new instance of Tracking.
8 9 10 |
# File 'lib/shipengine/domains/tracking.rb', line 8 def initialize @client = ShipEngine::Client.new end |
Instance Method Details
#start_tracking_package(params: {}) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/shipengine/domains/tracking.rb', line 21 def start_tracking_package(params: {}) response = @client.post( path: "#{ShipEngine::Constants::PATHS.v1.tracking.root}/start", options: params ) Hashie::Mash.new(response.body) end |
#stop_tracking_package(params: {}) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/shipengine/domains/tracking.rb', line 30 def stop_tracking_package(params: {}) response = @client.post( path: "#{ShipEngine::Constants::PATHS.v1.tracking.root}/stop", options: params ) Hashie::Mash.new(response.body) end |
#tracking_information(params: {}) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/shipengine/domains/tracking.rb', line 12 def tracking_information(params: {}) response = @client.get( path: ShipEngine::Constants::PATHS.v1.tracking.root, options: params ) Hashie::Mash.new(response.body) end |