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.



21641
21642
21643
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21641

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21639
21640
21641
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21639

def value
  @value
end

Class Method Details

.ALLObject



21661
21662
21663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21661

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



21646
21647
21648
21649
21650
21651
21652
21653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21646

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



21656
21657
21658
21659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21656

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

.has_inventoryObject



21665
21666
21667
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21665

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

.no_inventoryObject



21669
21670
21671
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21669

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

Instance Method Details

#to_hashObject



21673
21674
21675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21673

def to_hash
  value
end