Class: Io::Flow::V0::Models::DiscountRuleStatus
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DiscountRuleStatus
- 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
- .active ⇒ Object
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of DiscountRuleStatus for this value, creating a new instance for an unknown value.
- .expired ⇒ Object
-
.from_string(value) ⇒ Object
Returns the instance of DiscountRuleStatus for this value, or nil if not found.
- .scheduled ⇒ Object
Instance Method Summary collapse
-
#initialize(value) ⇒ DiscountRuleStatus
constructor
A new instance of DiscountRuleStatus.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ DiscountRuleStatus
Returns a new instance of DiscountRuleStatus.
16811 16812 16813 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16811 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16809 16810 16811 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16809 def value @value end |
Class Method Details
.active ⇒ Object
16835 16836 16837 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16835 def DiscountRuleStatus.active @@_active ||= DiscountRuleStatus.new('active') end |
.ALL ⇒ Object
16831 16832 16833 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16831 def DiscountRuleStatus.ALL @@all ||= [DiscountRuleStatus.active, DiscountRuleStatus.scheduled, DiscountRuleStatus.expired] end |
.apply(value) ⇒ Object
Returns the instance of DiscountRuleStatus for this value, creating a new instance for an unknown value
16816 16817 16818 16819 16820 16821 16822 16823 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16816 def DiscountRuleStatus.apply(value) if value.instance_of?(DiscountRuleStatus) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || DiscountRuleStatus.new(value)) end end |
.expired ⇒ Object
16843 16844 16845 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16843 def DiscountRuleStatus.expired @@_expired ||= DiscountRuleStatus.new('expired') end |
.from_string(value) ⇒ Object
Returns the instance of DiscountRuleStatus for this value, or nil if not found
16826 16827 16828 16829 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16826 def DiscountRuleStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleStatus.ALL.find { |v| v.value == value } end |
.scheduled ⇒ Object
16839 16840 16841 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16839 def DiscountRuleStatus.scheduled @@_scheduled ||= DiscountRuleStatus.new('scheduled') end |
Instance Method Details
#to_hash ⇒ Object
16847 16848 16849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16847 def to_hash value end |