Class: Io::Flow::V0::Models::InventoryStatus

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) ⇒ InventoryStatus

Returns a new instance of InventoryStatus.



19344
19345
19346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19344

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19342
19343
19344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19342

def value
  @value
end

Class Method Details

.ALLObject



19364
19365
19366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19364

def InventoryStatus.ALL
  @@all ||= [InventoryStatus.has_inventory, InventoryStatus.no_inventory]
end

.apply(value) ⇒ Object

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



19349
19350
19351
19352
19353
19354
19355
19356
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19349

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

.from_string(value) ⇒ Object

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



19359
19360
19361
19362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19359

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

.has_inventoryObject



19368
19369
19370
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19368

def InventoryStatus.has_inventory
  @@_has_inventory ||= InventoryStatus.new('has_inventory')
end

.no_inventoryObject



19372
19373
19374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19372

def InventoryStatus.no_inventory
  @@_no_inventory ||= InventoryStatus.new('no_inventory')
end

Instance Method Details

#to_hashObject



19376
19377
19378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19376

def to_hash
  value
end