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.



12590
12591
12592
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12590

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12588
12589
12590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12588

def value
  @value
end

Class Method Details

.ALLObject



12610
12611
12612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12610

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



12595
12596
12597
12598
12599
12600
12601
12602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12595

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



12605
12606
12607
12608
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12605

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

.numberObject



12618
12619
12620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12618

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

.textObject



12614
12615
12616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12614

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

Instance Method Details

#to_hashObject



12622
12623
12624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12622

def to_hash
  value
end