Class: Io::Flow::V0::Models::ExperienceInventoryItemStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceInventoryItemStatus
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of ExperienceInventoryItemStatus for this value, creating a new instance for an unknown value.
-
.available ⇒ Object
Inventory is generally available for purchase.
-
.from_string(value) ⇒ Object
Returns the instance of ExperienceInventoryItemStatus for this value, or nil if not found.
-
.low ⇒ Object
Inventory is low and may soon become unavailable for purchase.
-
.out_of_stock ⇒ Object
There is no inventory available and is not available for purchase.
Instance Method Summary collapse
-
#initialize(value) ⇒ ExperienceInventoryItemStatus
constructor
A new instance of ExperienceInventoryItemStatus.
- #to_hash ⇒ Object
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
#value ⇒ Object (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
.ALL ⇒ Object
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 |
.available ⇒ Object
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 |
.low ⇒ Object
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_stock ⇒ Object
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_hash ⇒ Object
12623 12624 12625 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12623 def to_hash value end |