Class: Io::Flow::V0::Models::InventoryStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::InventoryStatus
- 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 InventoryStatus for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of InventoryStatus for this value, or nil if not found.
- .has_inventory ⇒ Object
- .no_inventory ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ InventoryStatus
constructor
A new instance of InventoryStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ InventoryStatus
Returns a new instance of InventoryStatus.
14151 14152 14153 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14151 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14149 14150 14151 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14149 def value @value end |
Class Method Details
.ALL ⇒ Object
14171 14172 14173 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14171 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
14156 14157 14158 14159 14160 14161 14162 14163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14156 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
14166 14167 14168 14169 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14166 def InventoryStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) InventoryStatus.ALL.find { |v| v.value == value } end |
.has_inventory ⇒ Object
14175 14176 14177 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14175 def InventoryStatus.has_inventory @@_has_inventory ||= InventoryStatus.new('has_inventory') end |
.no_inventory ⇒ Object
14179 14180 14181 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14179 def InventoryStatus.no_inventory @@_no_inventory ||= InventoryStatus.new('no_inventory') end |
Instance Method Details
#to_hash ⇒ Object
14183 14184 14185 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14183 def to_hash value end |