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.



13483
13484
13485
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13483

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Class Method Details

.ALLObject



13503
13504
13505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13503

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



13488
13489
13490
13491
13492
13493
13494
13495
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13488

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



13498
13499
13500
13501
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13498

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



13508
13509
13510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13508

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

.mpnObject

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



13513
13514
13515
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13513

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

Instance Method Details

#to_hashObject



13517
13518
13519
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13517

def to_hash
  value
end