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
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#order_number ⇒ Object
readonly
Returns the value of attribute order_number.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
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.
28788 28789 28790 28791 28792 28793 28794 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28788 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))) @order_number = (x = opts.delete(:order_number); x.nil? ? nil : HttpClient::Preconditions.assert_class('order_number', x, String)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) @window = (x = opts.delete(:window); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
28786 28787 28788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28786 def attributes @attributes end |
#order_number ⇒ Object (readonly)
Returns the value of attribute order_number.
28786 28787 28788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28786 def order_number @order_number end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
28786 28787 28788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28786 def status @status end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
28786 28787 28788 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28786 def window @window end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28800 28801 28802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28800 def copy(incoming={}) TrackingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28804 28805 28806 28807 28808 28809 28810 28811 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28804 def to_hash { :status => status.nil? ? nil : status.value, :order_number => order_number, :attributes => attributes.nil? ? nil : attributes, :window => window.nil? ? nil : window.to_hash } end |
#to_json ⇒ Object
28796 28797 28798 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28796 def to_json JSON.dump(to_hash) end |