class Io::Flow::V0::Models::DiscountRuleStatus

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18924
def DiscountRuleStatus.ALL
  @@all ||= [DiscountRuleStatus.active, DiscountRuleStatus.scheduled, DiscountRuleStatus.expired]
end
active() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18928
def DiscountRuleStatus.active
  @@_active ||= DiscountRuleStatus.new('active')
end
apply(value) click to toggle source

Returns the instance of DiscountRuleStatus for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 18909
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() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18936
def DiscountRuleStatus.expired
  @@_expired ||= DiscountRuleStatus.new('expired')
end
from_string(value) click to toggle source

Returns the instance of DiscountRuleStatus for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 18919
def DiscountRuleStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  DiscountRuleStatus.ALL.find { |v| v.value == value }
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18904
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
scheduled() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18932
def DiscountRuleStatus.scheduled
  @@_scheduled ||= DiscountRuleStatus.new('scheduled')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18940
def to_hash
  value
end