Class: Io::Flow::V0::Models::TrackingStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ TrackingStatus

Returns a new instance of TrackingStatus.



16755
16756
16757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16755

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16753
16754
16755
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16753

def value
  @value
end

Class Method Details

.ALLObject



16775
16776
16777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16775

def TrackingStatus.ALL
  @@all ||= [TrackingStatus.label_created, TrackingStatus.pending, TrackingStatus.info_received, TrackingStatus.picked_up, TrackingStatus.in_transit, TrackingStatus.out_for_delivery, TrackingStatus.attempt_fail, TrackingStatus.delivered, TrackingStatus.exception, TrackingStatus.returned, TrackingStatus.expired]
end

.apply(value) ⇒ Object

Returns the instance of TrackingStatus for this value, creating a new instance for an unknown value



16760
16761
16762
16763
16764
16765
16766
16767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16760

def TrackingStatus.apply(value)
  if value.instance_of?(TrackingStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || TrackingStatus.new(value))
  end
end

.attempt_failObject



16803
16804
16805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16803

def TrackingStatus.attempt_fail
  @@_attempt_fail ||= TrackingStatus.new('attempt_fail')
end

.deliveredObject



16807
16808
16809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16807

def TrackingStatus.delivered
  @@_delivered ||= TrackingStatus.new('delivered')
end

.exceptionObject



16811
16812
16813
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16811

def TrackingStatus.exception
  @@_exception ||= TrackingStatus.new('exception')
end

.expiredObject



16819
16820
16821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16819

def TrackingStatus.expired
  @@_expired ||= TrackingStatus.new('expired')
end

.from_string(value) ⇒ Object

Returns the instance of TrackingStatus for this value, or nil if not found



16770
16771
16772
16773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16770

def TrackingStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  TrackingStatus.ALL.find { |v| v.value == value }
end

.in_transitObject



16795
16796
16797
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16795

def TrackingStatus.in_transit
  @@_in_transit ||= TrackingStatus.new('in_transit')
end

.info_receivedObject



16787
16788
16789
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16787

def TrackingStatus.info_received
  @@_info_received ||= TrackingStatus.new('info_received')
end

.label_createdObject



16779
16780
16781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16779

def TrackingStatus.label_created
  @@_label_created ||= TrackingStatus.new('label_created')
end

.out_for_deliveryObject



16799
16800
16801
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16799

def TrackingStatus.out_for_delivery
  @@_out_for_delivery ||= TrackingStatus.new('out_for_delivery')
end

.pendingObject



16783
16784
16785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16783

def TrackingStatus.pending
  @@_pending ||= TrackingStatus.new('pending')
end

.picked_upObject



16791
16792
16793
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16791

def TrackingStatus.picked_up
  @@_picked_up ||= TrackingStatus.new('picked_up')
end

.returnedObject



16815
16816
16817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16815

def TrackingStatus.returned
  @@_returned ||= TrackingStatus.new('returned')
end

Instance Method Details

#to_hashObject



16823
16824
16825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16823

def to_hash
  value
end