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.



16137
16138
16139
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16137

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16135
16136
16137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16135

def value
  @value
end

Class Method Details

.ALLObject



16157
16158
16159
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16157

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



16142
16143
16144
16145
16146
16147
16148
16149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16142

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



16152
16153
16154
16155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16152

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

.numberObject



16165
16166
16167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16165

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

.textObject



16161
16162
16163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16161

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

Instance Method Details

#to_hashObject



16169
16170
16171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16169

def to_hash
  value
end