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.



13456
13457
13458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13456

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13454
13455
13456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13454

def value
  @value
end

Class Method Details

.ALLObject



13476
13477
13478
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13476

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



13461
13462
13463
13464
13465
13466
13467
13468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13461

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



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

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



13481
13482
13483
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13481

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

.mpnObject

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



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

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

Instance Method Details

#to_hashObject



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

def to_hash
  value
end