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.



16404
16405
16406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16404

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16402
16403
16404
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16402

def value
  @value
end

Class Method Details

.ALLObject



16424
16425
16426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16424

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



16409
16410
16411
16412
16413
16414
16415
16416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16409

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



16419
16420
16421
16422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16419

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

.numberObject



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

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

.textObject



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

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

Instance Method Details

#to_hashObject



16436
16437
16438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16436

def to_hash
  value
end