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.



5650
5651
5652
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5650

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5648
5649
5650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5648

def value
  @value
end

Class Method Details

.ALLObject



5670
5671
5672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5670

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

.apply(value) ⇒ Object

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



5655
5656
5657
5658
5659
5660
5661
5662
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5655

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



5690
5691
5692
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5690

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

.deliveredObject



5694
5695
5696
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5694

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

.exceptionObject



5698
5699
5700
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5698

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

.expiredObject



5702
5703
5704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5702

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



5665
5666
5667
5668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5665

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

.in_transitObject



5682
5683
5684
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5682

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

.info_receivedObject



5678
5679
5680
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5678

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

.out_for_deliveryObject



5686
5687
5688
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5686

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

.pendingObject



5674
5675
5676
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5674

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

Instance Method Details

#to_hashObject



5706
5707
5708
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5706

def to_hash
  value
end