Class: Io::Flow::V0::Models::FlowFieldName
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FlowFieldName
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of FlowFieldName for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of FlowFieldName for this value, or nil if not found.
-
.item_number ⇒ Object
The Flow catalog item number.
-
.product_id_attribute ⇒ Object
A Flow catalog attribute named ‘product_id’.
-
.sku_attribute ⇒ Object
A Flow catalog attribute named ‘sku’.
Instance Method Summary collapse
-
#initialize(value) ⇒ FlowFieldName
constructor
A new instance of FlowFieldName.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ FlowFieldName
Returns a new instance of FlowFieldName.
10386 10387 10388 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10386 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10384 10385 10386 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10384 def value @value end |
Class Method Details
.ALL ⇒ Object
10406 10407 10408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10406 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
10391 10392 10393 10394 10395 10396 10397 10398 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10391 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
10401 10402 10403 10404 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10401 def FlowFieldName.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) FlowFieldName.ALL.find { |v| v.value == value } end |
.item_number ⇒ Object
The Flow catalog item number
10411 10412 10413 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10411 def FlowFieldName.item_number @@_item_number ||= FlowFieldName.new('item-number') end |
.product_id_attribute ⇒ Object
A Flow catalog attribute named ‘product_id’
10421 10422 10423 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10421 def FlowFieldName.product_id_attribute @@_product_id_attribute ||= FlowFieldName.new('product_id-attribute') end |
.sku_attribute ⇒ Object
A Flow catalog attribute named ‘sku’
10416 10417 10418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10416 def FlowFieldName.sku_attribute @@_sku_attribute ||= FlowFieldName.new('sku-attribute') end |
Instance Method Details
#to_hash ⇒ Object
10425 10426 10427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10425 def to_hash value end |