Class: Io::Flow::V0::Models::ExperienceInventoryItemStatus

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

Returns a new instance of ExperienceInventoryItemStatus.



12580
12581
12582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12580

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12578
12579
12580
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12578

def value
  @value
end

Class Method Details

.ALLObject



12600
12601
12602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12600

def ExperienceInventoryItemStatus.ALL
  @@all ||= [ExperienceInventoryItemStatus.available, ExperienceInventoryItemStatus.low, ExperienceInventoryItemStatus.out_of_stock]
end

.apply(value) ⇒ Object

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



12585
12586
12587
12588
12589
12590
12591
12592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12585

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

.availableObject

Inventory is generally available for purchase



12605
12606
12607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12605

def ExperienceInventoryItemStatus.available
  @@_available ||= ExperienceInventoryItemStatus.new('available')
end

.from_string(value) ⇒ Object

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



12595
12596
12597
12598
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12595

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

.lowObject

Inventory is low and may soon become unavailable for purchase. Unless there is a specific use case for low inventory, it can be treated the same as ‘available’



12612
12613
12614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12612

def ExperienceInventoryItemStatus.low
  @@_low ||= ExperienceInventoryItemStatus.new('low')
end

.out_of_stockObject

There is no inventory available and is not available for purchase. Sample actions that can be taken are hiding the item or marking as ‘sold out` on the frontend



12619
12620
12621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12619

def ExperienceInventoryItemStatus.out_of_stock
  @@_out_of_stock ||= ExperienceInventoryItemStatus.new('out_of_stock')
end

Instance Method Details

#to_hashObject



12623
12624
12625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12623

def to_hash
  value
end