Class: Io::Flow::V0::Models::FlowFieldName

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) ⇒ FlowFieldName

Returns a new instance of FlowFieldName.



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

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end

Class Method Details

.ALLObject



10404
10405
10406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10404

def FlowFieldName.ALL
  @@all ||= [FlowFieldName.item_number, FlowFieldName.sku_attribute, FlowFieldName.product_id_attribute]
end

.apply(value) ⇒ Object

Returns the instance of FlowFieldName for this value, creating a new instance for an unknown value



10389
10390
10391
10392
10393
10394
10395
10396
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10389

def FlowFieldName.apply(value)
  if value.instance_of?(FlowFieldName)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || FlowFieldName.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of FlowFieldName for this value, or nil if not found



10399
10400
10401
10402
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10399

def FlowFieldName.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  FlowFieldName.ALL.find { |v| v.value == value }
end

.item_numberObject

The Flow catalog item number



10409
10410
10411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10409

def FlowFieldName.item_number
  @@_item_number ||= FlowFieldName.new('item-number')
end

.product_id_attributeObject

A Flow catalog attribute named ‘product_id’



10419
10420
10421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10419

def FlowFieldName.product_id_attribute
  @@_product_id_attribute ||= FlowFieldName.new('product_id-attribute')
end

.sku_attributeObject

A Flow catalog attribute named ‘sku’



10414
10415
10416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10414

def FlowFieldName.sku_attribute
  @@_sku_attribute ||= FlowFieldName.new('sku-attribute')
end

Instance Method Details

#to_hashObject



10423
10424
10425
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10423

def to_hash
  value
end