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.



12916
12917
12918
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12916

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12914
12915
12916
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12914

def value
  @value
end

Class Method Details

.ALLObject



12936
12937
12938
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12936

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



12921
12922
12923
12924
12925
12926
12927
12928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12921

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



12931
12932
12933
12934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12931

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



12941
12942
12943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12941

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

.mpnObject

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



12946
12947
12948
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12946

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

Instance Method Details

#to_hashObject



12950
12951
12952
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12950

def to_hash
  value
end