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.



20067
20068
20069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20067

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20065
20066
20067
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20065

def value
  @value
end

Class Method Details

.ALLObject



20087
20088
20089
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20087

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



20072
20073
20074
20075
20076
20077
20078
20079
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20072

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



20082
20083
20084
20085
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20082

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

.numberObject



20095
20096
20097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20095

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

.textObject



20091
20092
20093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20091

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

Instance Method Details

#to_hashObject



20099
20100
20101
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20099

def to_hash
  value
end