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.



15316
15317
15318
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15316

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15314
15315
15316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15314

def value
  @value
end

Class Method Details

.ALLObject



15336
15337
15338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15336

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



15321
15322
15323
15324
15325
15326
15327
15328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15321

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



15340
15341
15342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15340

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

.deletingObject



15344
15345
15346
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15344

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



15331
15332
15333
15334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15331

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

.updatingObject



15348
15349
15350
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15348

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

Instance Method Details

#to_hashObject



15352
15353
15354
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15352

def to_hash
  value
end