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.



17387
17388
17389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17387

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17385
17386
17387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17385

def value
  @value
end

Class Method Details

.ALLObject



17407
17408
17409
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17407

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



17392
17393
17394
17395
17396
17397
17398
17399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17392

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



17402
17403
17404
17405
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17402

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

.numberObject



17415
17416
17417
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17415

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

.textObject



17411
17412
17413
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17411

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

Instance Method Details

#to_hashObject



17419
17420
17421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17419

def to_hash
  value
end