Class: Io::Flow::V0::Models::ExclusionRuleState

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ExclusionRuleState

Returns a new instance of ExclusionRuleState.



15999
16000
16001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15999

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15997
15998
15999
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15997

def value
  @value
end

Class Method Details

.ALLObject



16019
16020
16021
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16019

def ExclusionRuleState.ALL
  @@all ||= [ExclusionRuleState.current, ExclusionRuleState.deleting, ExclusionRuleState.updating]
end

.apply(value) ⇒ Object

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



16004
16005
16006
16007
16008
16009
16010
16011
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16004

def ExclusionRuleState.apply(value)
  if value.instance_of?(ExclusionRuleState)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ExclusionRuleState.new(value))
  end
end

.currentObject



16023
16024
16025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16023

def ExclusionRuleState.current
  @@_current ||= ExclusionRuleState.new('current')
end

.deletingObject



16027
16028
16029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16027

def ExclusionRuleState.deleting
  @@_deleting ||= ExclusionRuleState.new('deleting')
end

.from_string(value) ⇒ Object

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



16014
16015
16016
16017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16014

def ExclusionRuleState.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ExclusionRuleState.ALL.find { |v| v.value == value }
end

.updatingObject



16031
16032
16033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16031

def ExclusionRuleState.updating
  @@_updating ||= ExclusionRuleState.new('updating')
end

Instance Method Details

#to_hashObject



16035
16036
16037
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16035

def to_hash
  value
end