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.



8414
8415
8416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8414

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8412
8413
8414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8412

def value
  @value
end

Class Method Details

.ALLObject



8434
8435
8436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8434

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



8419
8420
8421
8422
8423
8424
8425
8426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8419

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



8429
8430
8431
8432
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8429

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



8439
8440
8441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8439

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

.mpnObject

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



8444
8445
8446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8444

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

Instance Method Details

#to_hashObject



8448
8449
8450
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8448

def to_hash
  value
end