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.



15208
15209
15210
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15208

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15206
15207
15208
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15206

def value
  @value
end

Class Method Details

.ALLObject



15228
15229
15230
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15228

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



15213
15214
15215
15216
15217
15218
15219
15220
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15213

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



15223
15224
15225
15226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15223

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



15233
15234
15235
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15233

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

.mpnObject

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



15238
15239
15240
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15238

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

Instance Method Details

#to_hashObject



15242
15243
15244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15242

def to_hash
  value
end