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.



13069
13070
13071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13069

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13067
13068
13069
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13067

def value
  @value
end

Class Method Details

.ALLObject



13089
13090
13091
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13089

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



13074
13075
13076
13077
13078
13079
13080
13081
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13074

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



13084
13085
13086
13087
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13084

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

.numberObject



13097
13098
13099
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13097

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

.textObject



13093
13094
13095
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13093

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

Instance Method Details

#to_hashObject



13101
13102
13103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13101

def to_hash
  value
end