Class: ReactiveShipping::CPPWSTrackingResponse
- Inherits:
-
TrackingResponse
- Object
- Response
- TrackingResponse
- ReactiveShipping::CPPWSTrackingResponse
- Includes:
- CPPWSErrorResponse
- Defined in:
- lib/reactive_shipping/carriers/canada_post_pws.rb
Constant Summary collapse
- DELIVERED_EVENT_CODES =
%w(1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1441 1442 1496 1497 1498 1499 5300)
Instance Attribute Summary collapse
-
#change_reason ⇒ Object
readonly
Returns the value of attribute change_reason.
-
#changed_date ⇒ Object
readonly
Returns the value of attribute changed_date.
-
#customer_number ⇒ Object
readonly
Returns the value of attribute customer_number.
-
#expected_date ⇒ Object
readonly
Returns the value of attribute expected_date.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
Attributes included from CPPWSErrorResponse
Attributes inherited from TrackingResponse
#actual_delivery_date, #attempted_delivery_date, #carrier, #carrier_name, #delivery_signature, #destination, #origin, #scheduled_delivery_date, #ship_time, #shipment_events, #shipper_address, #status, #status_code, #status_description, #tracking_number
Attributes inherited from Response
#message, #params, #request, #test, #xml
Instance Method Summary collapse
- #actual_delivery_time ⇒ Object
- #delivered? ⇒ Boolean
-
#initialize(success, message, params = {}, options = {}) ⇒ CPPWSTrackingResponse
constructor
A new instance of CPPWSTrackingResponse.
Methods included from CPPWSErrorResponse
Methods inherited from TrackingResponse
#==, #has_exception?, #is_delivered?, #latest_event
Methods inherited from Response
Constructor Details
#initialize(success, message, params = {}, options = {}) ⇒ CPPWSTrackingResponse
Returns a new instance of CPPWSTrackingResponse.
839 840 841 842 843 844 845 846 847 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 839 def initialize(success, , params = {}, = {}) handle_error(, ) super @service_name = [:service_name] @expected_date = [:expected_date] @changed_date = [:changed_date] @change_reason = [:change_reason] @customer_number = [:customer_number] end |
Instance Attribute Details
#change_reason ⇒ Object (readonly)
Returns the value of attribute change_reason.
837 838 839 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 837 def change_reason @change_reason end |
#changed_date ⇒ Object (readonly)
Returns the value of attribute changed_date.
837 838 839 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 837 def changed_date @changed_date end |
#customer_number ⇒ Object (readonly)
Returns the value of attribute customer_number.
837 838 839 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 837 def customer_number @customer_number end |
#expected_date ⇒ Object (readonly)
Returns the value of attribute expected_date.
837 838 839 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 837 def expected_date @expected_date end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
837 838 839 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 837 def service_name @service_name end |
Instance Method Details
#actual_delivery_time ⇒ Object
853 854 855 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 853 def actual_delivery_time delivered_event.time if delivered? end |
#delivered? ⇒ Boolean
849 850 851 |
# File 'lib/reactive_shipping/carriers/canada_post_pws.rb', line 849 def delivered? !delivered_event.nil? end |