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.



12657
12658
12659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12657

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12655
12656
12657
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12655

def value
  @value
end

Class Method Details

.ALLObject



12677
12678
12679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12677

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



12662
12663
12664
12665
12666
12667
12668
12669
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12662

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



12672
12673
12674
12675
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12672

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

.numberObject



12685
12686
12687
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12685

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

.textObject



12681
12682
12683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12681

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

Instance Method Details

#to_hashObject



12689
12690
12691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12689

def to_hash
  value
end