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.



16467
16468
16469
16470
16471
16472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16467

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))
  @metadata = (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.



16465
16466
16467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16465

def 
  @metadata
end

#order_numberObject (readonly)

Returns the value of attribute order_number.



16465
16466
16467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16465

def order_number
  @order_number
end

#statusObject (readonly)

Returns the value of attribute status.



16465
16466
16467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16465

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



16478
16479
16480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16478

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

#to_hashObject



16482
16483
16484
16485
16486
16487
16488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16482

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

#to_jsonObject



16474
16475
16476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16474

def to_json
  JSON.dump(to_hash)
end