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.



13716
13717
13718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13716

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13714
13715
13716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13714

def value
  @value
end

Class Method Details

.ALLObject



13736
13737
13738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13736

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



13721
13722
13723
13724
13725
13726
13727
13728
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13721

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



13731
13732
13733
13734
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13731

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

.has_inventoryObject



13740
13741
13742
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13740

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

.no_inventoryObject



13744
13745
13746
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13744

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

Instance Method Details

#to_hashObject



13748
13749
13750
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13748

def to_hash
  value
end