Class: Deliveries::Couriers::Spring::Shipments::Trace
- Inherits:
-
Object
- Object
- Deliveries::Couriers::Spring::Shipments::Trace
- Defined in:
- lib/deliveries/couriers/spring/shipments/trace.rb,
lib/deliveries/couriers/spring/shipments/trace/format_response.rb
Defined Under Namespace
Classes: FormatResponse
Instance Attribute Summary collapse
-
#tracking_code ⇒ Object
Returns the value of attribute tracking_code.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(tracking_code:) ⇒ Trace
constructor
A new instance of Trace.
Constructor Details
#initialize(tracking_code:) ⇒ Trace
Returns a new instance of Trace.
8 9 10 |
# File 'lib/deliveries/couriers/spring/shipments/trace.rb', line 8 def initialize(tracking_code:) self.tracking_code = tracking_code end |
Instance Attribute Details
#tracking_code ⇒ Object
Returns the value of attribute tracking_code.
6 7 8 |
# File 'lib/deliveries/couriers/spring/shipments/trace.rb', line 6 def tracking_code @tracking_code end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/deliveries/couriers/spring/shipments/trace.rb', line 12 def execute params = { Apikey: Deliveries::Couriers::Spring.config(:api_key), Command: 'TrackShipment', Shipment: { TrackingNumber: tracking_code } } response = Deliveries::Couriers::Spring::Request.execute(params: params) response[:Shipment] end |