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.



16431
16432
16433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16431

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16429
16430
16431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16429

def value
  @value
end

Class Method Details

.ALLObject



16451
16452
16453
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16451

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



16436
16437
16438
16439
16440
16441
16442
16443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16436

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



16446
16447
16448
16449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16446

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

.numberObject



16459
16460
16461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16459

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

.textObject



16455
16456
16457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16455

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

Instance Method Details

#to_hashObject



16463
16464
16465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16463

def to_hash
  value
end