Class: Io::Flow::V0::Models::TrackingForm

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TrackingForm

Returns a new instance of TrackingForm.



14730
14731
14732
14733
14734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14730

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

#metadataObject (readonly)

Returns the value of attribute metadata.



14728
14729
14730
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14728

def 
  
end

#statusObject (readonly)

Returns the value of attribute status.



14728
14729
14730
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14728

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



14740
14741
14742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14740

def copy(incoming={})
  TrackingForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



14744
14745
14746
14747
14748
14749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14744

def to_hash
  {
    :status => status.nil? ? nil : status.value,
    :metadata => 
  }
end

#to_jsonObject



14736
14737
14738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14736

def to_json
  JSON.dump(to_hash)
end