Class: Io::Flow::V0::Models::InputSpecificationType

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

Returns a new instance of InputSpecificationType.



13624
13625
13626
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13624

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13622
13623
13624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13622

def value
  @value
end

Class Method Details

.ALLObject



13644
13645
13646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13644

def InputSpecificationType.ALL
  @@all ||= [InputSpecificationType.text, InputSpecificationType.number]
end

.apply(value) ⇒ Object

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



13629
13630
13631
13632
13633
13634
13635
13636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13629

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

.from_string(value) ⇒ Object

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



13639
13640
13641
13642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13639

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

.numberObject



13652
13653
13654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13652

def InputSpecificationType.number
  @@_number ||= InputSpecificationType.new('number')
end

.textObject



13648
13649
13650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13648

def InputSpecificationType.text
  @@_text ||= InputSpecificationType.new('text')
end

Instance Method Details

#to_hashObject



13656
13657
13658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13656

def to_hash
  value
end