Class: Io::Flow::V0::Models::ConfigurationType

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) ⇒ ConfigurationType

Returns a new instance of ConfigurationType.



12488
12489
12490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12488

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12486
12487
12488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12486

def value
  @value
end

Class Method Details

.ALLObject



12508
12509
12510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12508

def ConfigurationType.ALL
  @@all ||= [ConfigurationType.default, ConfigurationType.variant]
end

.apply(value) ⇒ Object

Returns the instance of ConfigurationType for this value, creating a new instance for an unknown value



12493
12494
12495
12496
12497
12498
12499
12500
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12493

def ConfigurationType.apply(value)
  if value.instance_of?(ConfigurationType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ConfigurationType.new(value))
  end
end

.defaultObject



12512
12513
12514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12512

def ConfigurationType.default
  @@_default ||= ConfigurationType.new('default')
end

.from_string(value) ⇒ Object

Returns the instance of ConfigurationType for this value, or nil if not found



12503
12504
12505
12506
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12503

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

.variantObject



12516
12517
12518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12516

def ConfigurationType.variant
  @@_variant ||= ConfigurationType.new('variant')
end

Instance Method Details

#to_hashObject



12520
12521
12522
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12520

def to_hash
  value
end