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.



8080
8081
8082
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8080

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8078
8079
8080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8078

def value
  @value
end

Class Method Details

.ALLObject



8100
8101
8102
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8100

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



8085
8086
8087
8088
8089
8090
8091
8092
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8085

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



8095
8096
8097
8098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8095

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



8105
8106
8107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8105

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

.mpnObject

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



8110
8111
8112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8110

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

Instance Method Details

#to_hashObject



8114
8115
8116
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8114

def to_hash
  value
end