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.



10351
10352
10353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10351

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10349
10350
10351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10349

def value
  @value
end

Class Method Details

.ALLObject



10371
10372
10373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10371

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



10356
10357
10358
10359
10360
10361
10362
10363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10356

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



10366
10367
10368
10369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10366

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



10376
10377
10378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10376

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

.mpnObject

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



10381
10382
10383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10381

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

Instance Method Details

#to_hashObject



10385
10386
10387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10385

def to_hash
  value
end