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.



16944
16945
16946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16944

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16942
16943
16944
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16942

def value
  @value
end

Class Method Details

.ALLObject



16964
16965
16966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16964

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



16949
16950
16951
16952
16953
16954
16955
16956
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16949

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



16959
16960
16961
16962
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16959

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

.numberObject



16972
16973
16974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16972

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

.textObject



16968
16969
16970
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16968

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

Instance Method Details

#to_hashObject



16976
16977
16978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16976

def to_hash
  value
end