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.



14983
14984
14985
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14983

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14981
14982
14983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14981

def value
  @value
end

Class Method Details

.ALLObject



15003
15004
15005
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15003

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



14988
14989
14990
14991
14992
14993
14994
14995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14988

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



15007
15008
15009
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15007

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

.deletingObject



15011
15012
15013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15011

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



14998
14999
15000
15001
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14998

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

.updatingObject



15015
15016
15017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15015

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

Instance Method Details

#to_hashObject



15019
15020
15021
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15019

def to_hash
  value
end