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.



17205
17206
17207
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17205

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17203
17204
17205
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17203

def value
  @value
end

Class Method Details

.ALLObject



17225
17226
17227
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17225

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



17210
17211
17212
17213
17214
17215
17216
17217
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17210

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



17220
17221
17222
17223
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17220

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

.numberObject



17233
17234
17235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17233

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

.textObject



17229
17230
17231
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17229

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

Instance Method Details

#to_hashObject



17237
17238
17239
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17237

def to_hash
  value
end