Class: Io::Flow::V0::Models::AttributeIntent
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AttributeIntent
- 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 AttributeIntent for this value, creating a new instance for an unknown value.
-
.brand ⇒ Object
A brand name of the item (for retailers that sell multiple brands).
-
.consumer_url ⇒ Object
A URL of the product detail page of the item.
-
.from_string(value) ⇒ Object
Returns the instance of AttributeIntent for this value, or nil if not found.
-
.fulfillment_method ⇒ Object
Identifies whether the item is a physical or digital good.
-
.gtin ⇒ Object
The Global Trade Item Number of this item.
-
.hazardous ⇒ Object
Identifies whether this item may contain hazardous materials.
-
.mpn ⇒ Object
The Manufacturer Part Number of this item.
-
.price ⇒ Object
A price for the item in the organization’s base currency (will be localized based on each Experience’s pricing policy).
-
.product_id ⇒ Object
An identifier used to group items that are variations of the same product, such as different sizes or colors of the same shirt.
-
.size ⇒ Object
A size label of the item.
-
.sku ⇒ Object
An SKU for the item.
-
.taxability ⇒ Object
Identifies whether taxes are applicable to an item.
Instance Method Summary collapse
-
#initialize(value) ⇒ AttributeIntent
constructor
A new instance of AttributeIntent.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AttributeIntent
Returns a new instance of AttributeIntent.
8207 8208 8209 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8207 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8205 8206 8207 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8205 def value @value end |
Class Method Details
.ALL ⇒ Object
8227 8228 8229 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8227 def AttributeIntent.ALL @@all ||= [AttributeIntent.brand, AttributeIntent.product_id, AttributeIntent.fulfillment_method, AttributeIntent.hazardous, AttributeIntent.price, AttributeIntent.size, AttributeIntent.sku, AttributeIntent.taxability, AttributeIntent.consumer_url, AttributeIntent.gtin, AttributeIntent.mpn] end |
.apply(value) ⇒ Object
Returns the instance of AttributeIntent for this value, creating a new instance for an unknown value
8212 8213 8214 8215 8216 8217 8218 8219 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8212 def AttributeIntent.apply(value) if value.instance_of?(AttributeIntent) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || AttributeIntent.new(value)) end end |
.brand ⇒ Object
A brand name of the item (for retailers that sell multiple brands)
8232 8233 8234 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8232 def AttributeIntent.brand @@_brand ||= AttributeIntent.new('brand') end |
.consumer_url ⇒ Object
A URL of the product detail page of the item
8274 8275 8276 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8274 def AttributeIntent.consumer_url @@_consumer_url ||= AttributeIntent.new('consumer_url') end |
.from_string(value) ⇒ Object
Returns the instance of AttributeIntent for this value, or nil if not found
8222 8223 8224 8225 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8222 def AttributeIntent.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AttributeIntent.ALL.find { |v| v.value == value } end |
.fulfillment_method ⇒ Object
Identifies whether the item is a physical or digital good
8243 8244 8245 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8243 def AttributeIntent.fulfillment_method @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method') end |
.gtin ⇒ Object
The Global Trade Item Number of this item.
8279 8280 8281 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8279 def AttributeIntent.gtin @@_gtin ||= AttributeIntent.new('gtin') end |
.hazardous ⇒ Object
Identifies whether this item may contain hazardous materials
8248 8249 8250 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8248 def AttributeIntent.hazardous @@_hazardous ||= AttributeIntent.new('hazardous') end |
.mpn ⇒ Object
The Manufacturer Part Number of this item.
8284 8285 8286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8284 def AttributeIntent.mpn @@_mpn ||= AttributeIntent.new('mpn') end |
.price ⇒ Object
A price for the item in the organization’s base currency (will be localized based on each Experience’s pricing policy)
8254 8255 8256 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8254 def AttributeIntent.price @@_price ||= AttributeIntent.new('price') end |
.product_id ⇒ Object
An identifier used to group items that are variations of the same product, such as different sizes or colors of the same shirt
8238 8239 8240 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8238 def AttributeIntent.product_id @@_product_id ||= AttributeIntent.new('product_id') end |
.size ⇒ Object
A size label of the item
8259 8260 8261 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8259 def AttributeIntent.size @@_size ||= AttributeIntent.new('size') end |
.sku ⇒ Object
An SKU for the item
8264 8265 8266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8264 def AttributeIntent.sku @@_sku ||= AttributeIntent.new('sku') end |
.taxability ⇒ Object
Identifies whether taxes are applicable to an item
8269 8270 8271 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8269 def AttributeIntent.taxability @@_taxability ||= AttributeIntent.new('taxability') end |
Instance Method Details
#to_hash ⇒ Object
8288 8289 8290 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8288 def to_hash value end |