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.
14682 14683 14684 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14682 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14680 14681 14682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14680 def value @value end |
Class Method Details
.active ⇒ Object
14706 14707 14708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14706 def DiscountRuleStatus.active @@_active ||= DiscountRuleStatus.new('active') end |
.ALL ⇒ Object
14702 14703 14704 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14702 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
14687 14688 14689 14690 14691 14692 14693 14694 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14687 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
14714 14715 14716 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14714 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
14697 14698 14699 14700 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14697 def DiscountRuleStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleStatus.ALL.find { |v| v.value == value } end |
.scheduled ⇒ Object
14710 14711 14712 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14710 def DiscountRuleStatus.scheduled @@_scheduled ||= DiscountRuleStatus.new('scheduled') end |
Instance Method Details
#to_hash ⇒ Object
14718 14719 14720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14718 def to_hash value end |