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.



9289
9290
9291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9289

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9287
9288
9289
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9287

def value
  @value
end

Class Method Details

.ALLObject



9309
9310
9311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9309

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



9294
9295
9296
9297
9298
9299
9300
9301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9294

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



9304
9305
9306
9307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9304

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



9314
9315
9316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9314

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

.mpnObject

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



9319
9320
9321
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9319

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

Instance Method Details

#to_hashObject



9323
9324
9325
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9323

def to_hash
  value
end