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.



19302
19303
19304
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19302

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19300
19301
19302
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19300

def value
  @value
end

Class Method Details

.ALLObject



19322
19323
19324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19322

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



19307
19308
19309
19310
19311
19312
19313
19314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19307

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



19317
19318
19319
19320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19317

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

.numberObject



19330
19331
19332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19330

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

.textObject



19326
19327
19328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19326

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

Instance Method Details

#to_hashObject



19334
19335
19336
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19334

def to_hash
  value
end