Class: Io::Flow::V0::Models::IncomingFieldName

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) ⇒ IncomingFieldName

Returns a new instance of IncomingFieldName.



13471
13472
13473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13471

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13469
13470
13471
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13469

def value
  @value
end

Class Method Details

.ALLObject



13491
13492
13493
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13491

def IncomingFieldName.ALL
  @@all ||= [IncomingFieldName.id, IncomingFieldName.mpn]
end

.apply(value) ⇒ Object

Returns the instance of IncomingFieldName for this value, creating a new instance for an unknown value



13476
13477
13478
13479
13480
13481
13482
13483
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13476

def IncomingFieldName.apply(value)
  if value.instance_of?(IncomingFieldName)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || IncomingFieldName.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of IncomingFieldName for this value, or nil if not found



13486
13487
13488
13489
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13486

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

.idObject

The id field of the incoming feed



13496
13497
13498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13496

def IncomingFieldName.id
  @@_id ||= IncomingFieldName.new('id')
end

.mpnObject

The Manufacturer’s Product Number (MPN) field of the incoming feed



13501
13502
13503
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13501

def IncomingFieldName.mpn
  @@_mpn ||= IncomingFieldName.new('mpn')
end

Instance Method Details

#to_hashObject



13505
13506
13507
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13505

def to_hash
  value
end