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.



5517
5518
5519
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5517

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5515
5516
5517
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5515

def value
  @value
end

Class Method Details

.ALLObject



5537
5538
5539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5537

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



5522
5523
5524
5525
5526
5527
5528
5529
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5522

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



5557
5558
5559
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5557

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

.deliveredObject



5561
5562
5563
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5561

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

.exceptionObject



5565
5566
5567
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5565

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

.expiredObject



5569
5570
5571
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5569

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



5532
5533
5534
5535
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5532

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

.in_transitObject



5549
5550
5551
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5549

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

.info_receivedObject



5545
5546
5547
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5545

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

.out_for_deliveryObject



5553
5554
5555
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5553

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

.pendingObject



5541
5542
5543
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5541

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

Instance Method Details

#to_hashObject



5573
5574
5575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5573

def to_hash
  value
end