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.



20163
20164
20165
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20163

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20161
20162
20163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20161

def value
  @value
end

Class Method Details

.ALLObject



20183
20184
20185
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20183

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



20168
20169
20170
20171
20172
20173
20174
20175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20168

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



20187
20188
20189
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20187

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

.deletingObject



20191
20192
20193
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20191

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



20178
20179
20180
20181
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20178

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

.updatingObject



20195
20196
20197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20195

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

Instance Method Details

#to_hashObject



20199
20200
20201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20199

def to_hash
  value
end