Class: Io::Flow::V0::Models::TrackingForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TrackingForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Top level tracking information which contains labels. In cases where shipments are re-labeled, you will see multiple labels for each tracking allowing simple access to see where a shipment is - with which carrier and with the local tracking number
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TrackingForm
constructor
A new instance of TrackingForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TrackingForm
Returns a new instance of TrackingForm.
14635 14636 14637 14638 14639 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14635 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) @status = (x = opts.delete(:status); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TrackingStatus) ? x : ::Io::Flow::V0::Models::TrackingStatus.apply(x))) = (x = opts.delete(:metadata); x.nil? ? nil : HttpClient::Preconditions.assert_class('metadata', HttpClient::Helper.to_object(x), Hash)) end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
14633 14634 14635 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14633 def end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
14633 14634 14635 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14633 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
14645 14646 14647 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14645 def copy(incoming={}) TrackingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
14649 14650 14651 14652 14653 14654 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14649 def to_hash { :status => status.nil? ? nil : status.value, :metadata => } end |
#to_json ⇒ Object
14641 14642 14643 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14641 def to_json JSON.dump(to_hash) end |