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.



13207
13208
13209
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13207

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13205
13206
13207
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13205

def value
  @value
end

Class Method Details

.ALLObject



13227
13228
13229
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13227

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



13212
13213
13214
13215
13216
13217
13218
13219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13212

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



13222
13223
13224
13225
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13222

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

.numberObject



13235
13236
13237
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13235

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

.textObject



13231
13232
13233
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13231

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

Instance Method Details

#to_hashObject



13239
13240
13241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13239

def to_hash
  value
end