Class: Io::Flow::V0::Models::SubcatalogItemStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SubcatalogItemStatus
- 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 SubcatalogItemStatus for this value, creating a new instance for an unknown value.
-
.excluded ⇒ Object
Item is excluded based on targeting query.
-
.from_string(value) ⇒ Object
Returns the instance of SubcatalogItemStatus for this value, or nil if not found.
-
.included ⇒ Object
Item is included.
-
.restricted ⇒ Object
Item is restricted and will be treated as excluded.
Instance Method Summary collapse
-
#initialize(value) ⇒ SubcatalogItemStatus
constructor
A new instance of SubcatalogItemStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ SubcatalogItemStatus
Returns a new instance of SubcatalogItemStatus.
9213 9214 9215 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9213 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9211 9212 9213 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9211 def value @value end |
Class Method Details
.ALL ⇒ Object
9233 9234 9235 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9233 def SubcatalogItemStatus.ALL @@all ||= [SubcatalogItemStatus.excluded, SubcatalogItemStatus.included, SubcatalogItemStatus.restricted] end |
.apply(value) ⇒ Object
Returns the instance of SubcatalogItemStatus for this value, creating a new instance for an unknown value
9218 9219 9220 9221 9222 9223 9224 9225 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9218 def SubcatalogItemStatus.apply(value) if value.instance_of?(SubcatalogItemStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || SubcatalogItemStatus.new(value)) end end |
.excluded ⇒ Object
Item is excluded based on targeting query. This is separate from an item marked as restricted.
9239 9240 9241 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9239 def SubcatalogItemStatus.excluded @@_excluded ||= SubcatalogItemStatus.new('excluded') end |
.from_string(value) ⇒ Object
Returns the instance of SubcatalogItemStatus for this value, or nil if not found
9228 9229 9230 9231 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9228 def SubcatalogItemStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) SubcatalogItemStatus.ALL.find { |v| v.value == value } end |
.included ⇒ Object
Item is included
9244 9245 9246 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9244 def SubcatalogItemStatus.included @@_included ||= SubcatalogItemStatus.new('included') end |
.restricted ⇒ Object
Item is restricted and will be treated as excluded
9249 9250 9251 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9249 def SubcatalogItemStatus.restricted @@_restricted ||= SubcatalogItemStatus.new('restricted') end |
Instance Method Details
#to_hash ⇒ Object
9253 9254 9255 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9253 def to_hash value end |