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.



11276
11277
11278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11276

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11274
11275
11276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11274

def value
  @value
end

Class Method Details

.ALLObject



11296
11297
11298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11296

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



11281
11282
11283
11284
11285
11286
11287
11288
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11281

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



11324
11325
11326
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11324

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

.deliveredObject



11328
11329
11330
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11328

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

.exceptionObject



11332
11333
11334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11332

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

.expiredObject



11340
11341
11342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11340

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



11291
11292
11293
11294
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11291

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

.in_transitObject



11316
11317
11318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11316

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

.info_receivedObject



11308
11309
11310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11308

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

.label_createdObject



11300
11301
11302
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11300

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

.out_for_deliveryObject



11320
11321
11322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11320

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

.pendingObject



11304
11305
11306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11304

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

.picked_upObject



11312
11313
11314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11312

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

.returnedObject



11336
11337
11338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11336

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

Instance Method Details

#to_hashObject



11344
11345
11346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11344

def to_hash
  value
end