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.



16209
16210
16211
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16209

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16207
16208
16209
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16207

def value
  @value
end

Class Method Details

.ALLObject



16229
16230
16231
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16229

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



16214
16215
16216
16217
16218
16219
16220
16221
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16214

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



16224
16225
16226
16227
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16224

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

.numberObject



16237
16238
16239
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16237

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

.textObject



16233
16234
16235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16233

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

Instance Method Details

#to_hashObject



16241
16242
16243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16241

def to_hash
  value
end