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.



18917
18918
18919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18917

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18915
18916
18917
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18915

def value
  @value
end

Class Method Details

.ALLObject



18937
18938
18939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18937

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



18922
18923
18924
18925
18926
18927
18928
18929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18922

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



18965
18966
18967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18965

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

.deliveredObject



18969
18970
18971
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18969

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

.exceptionObject



18973
18974
18975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18973

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

.expiredObject



18981
18982
18983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18981

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



18932
18933
18934
18935
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18932

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

.in_transitObject



18957
18958
18959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18957

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

.info_receivedObject



18949
18950
18951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18949

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

.label_createdObject



18941
18942
18943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18941

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

.out_for_deliveryObject



18961
18962
18963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18961

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

.pendingObject



18945
18946
18947
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18945

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

.picked_upObject



18953
18954
18955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18953

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

.returnedObject



18977
18978
18979
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18977

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

Instance Method Details

#to_hashObject



18985
18986
18987
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18985

def to_hash
  value
end