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.
15107 15108 15109 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15107 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
15105 15106 15107 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15105 def value @value end |
Class Method Details
.active ⇒ Object
15131 15132 15133 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15131 def DiscountRuleStatus.active @@_active ||= DiscountRuleStatus.new('active') end |
.ALL ⇒ Object
15127 15128 15129 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15127 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
15112 15113 15114 15115 15116 15117 15118 15119 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15112 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
15139 15140 15141 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15139 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
15122 15123 15124 15125 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15122 def DiscountRuleStatus.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleStatus.ALL.find { |v| v.value == value } end |
.scheduled ⇒ Object
15135 15136 15137 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15135 def DiscountRuleStatus.scheduled @@_scheduled ||= DiscountRuleStatus.new('scheduled') end |
Instance Method Details
#to_hash ⇒ Object
15143 15144 15145 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15143 def to_hash value end |