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.



15681
15682
15683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15681

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15679
15680
15681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15679

def value
  @value
end

Class Method Details

.ALLObject



15701
15702
15703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15701

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



15686
15687
15688
15689
15690
15691
15692
15693
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15686

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



15705
15706
15707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15705

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

.deletingObject



15709
15710
15711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15709

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



15696
15697
15698
15699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15696

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

.updatingObject



15713
15714
15715
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15713

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

Instance Method Details

#to_hashObject



15717
15718
15719
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15717

def to_hash
  value
end