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.



15289
15290
15291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15289

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15287
15288
15289
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15287

def value
  @value
end

Class Method Details

.ALLObject



15309
15310
15311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15309

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



15294
15295
15296
15297
15298
15299
15300
15301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15294

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



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

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

.deletingObject



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

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



15304
15305
15306
15307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15304

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

.updatingObject



15321
15322
15323
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15321

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

Instance Method Details

#to_hashObject



15325
15326
15327
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15325

def to_hash
  value
end