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.



8927
8928
8929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8927

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8925
8926
8927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8925

def value
  @value
end

Class Method Details

.ALLObject



8947
8948
8949
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8947

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



8932
8933
8934
8935
8936
8937
8938
8939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8932

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



8942
8943
8944
8945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8942

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



8952
8953
8954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8952

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

.product_id_attributeObject

A Flow catalog attribute named ‘product_id’



8962
8963
8964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8962

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

.sku_attributeObject

A Flow catalog attribute named ‘sku’



8957
8958
8959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8957

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

Instance Method Details

#to_hashObject



8966
8967
8968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8966

def to_hash
  value
end