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.



17974
17975
17976
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17974

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17972
17973
17974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17972

def value
  @value
end

Class Method Details

.ALLObject



17994
17995
17996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17994

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



17979
17980
17981
17982
17983
17984
17985
17986
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17979

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



17998
17999
18000
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17998

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

.deletingObject



18002
18003
18004
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18002

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



17989
17990
17991
17992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17989

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

.updatingObject



18006
18007
18008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18006

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

Instance Method Details

#to_hashObject



18010
18011
18012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18010

def to_hash
  value
end