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).
-
.color ⇒ Object
The color of the item.
-
.consumer_url ⇒ Object
A URL of the product detail page of the item.
-
.countries_of_origin ⇒ Object
A space separated list of the countries of origin for this item.
-
.facet ⇒ Object
Identifies a facet.
-
.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.
12338 12339 12340 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12338 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12336 12337 12338 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12336 def value @value end |
Class Method Details
.ALL ⇒ Object
12358 12359 12360 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12358 def AttributeIntent.ALL @@all ||= [AttributeIntent.brand, AttributeIntent.color, AttributeIntent.countries_of_origin, AttributeIntent.product_id, AttributeIntent.fulfillment_method, AttributeIntent.hazardous, AttributeIntent.price, AttributeIntent.size, AttributeIntent.sku, AttributeIntent.taxability, AttributeIntent.consumer_url, AttributeIntent.gtin, AttributeIntent.mpn, AttributeIntent.facet] end |
.apply(value) ⇒ Object
Returns the instance of AttributeIntent for this value, creating a new instance for an unknown value
12343 12344 12345 12346 12347 12348 12349 12350 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12343 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)
12363 12364 12365 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12363 def AttributeIntent.brand @@_brand ||= AttributeIntent.new('brand') end |
.color ⇒ Object
The color of the item
12368 12369 12370 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12368 def AttributeIntent.color @@_color ||= AttributeIntent.new('color') end |
.consumer_url ⇒ Object
A URL of the product detail page of the item
12415 12416 12417 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12415 def AttributeIntent.consumer_url @@_consumer_url ||= AttributeIntent.new('consumer_url') end |
.countries_of_origin ⇒ Object
A space separated list of the countries of origin for this item
12373 12374 12375 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12373 def AttributeIntent.countries_of_origin @@_countries_of_origin ||= AttributeIntent.new('countries_of_origin') end |
.facet ⇒ Object
Identifies a facet.
12430 12431 12432 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12430 def AttributeIntent.facet @@_facet ||= AttributeIntent.new('facet') end |
.from_string(value) ⇒ Object
Returns the instance of AttributeIntent for this value, or nil if not found
12353 12354 12355 12356 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12353 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
12384 12385 12386 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12384 def AttributeIntent.fulfillment_method @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method') end |
.gtin ⇒ Object
The Global Trade Item Number of this item.
12420 12421 12422 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12420 def AttributeIntent.gtin @@_gtin ||= AttributeIntent.new('gtin') end |
.hazardous ⇒ Object
Identifies whether this item may contain hazardous materials
12389 12390 12391 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12389 def AttributeIntent.hazardous @@_hazardous ||= AttributeIntent.new('hazardous') end |
.mpn ⇒ Object
The Manufacturer Part Number of this item.
12425 12426 12427 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12425 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)
12395 12396 12397 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12395 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
12379 12380 12381 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12379 def AttributeIntent.product_id @@_product_id ||= AttributeIntent.new('product_id') end |
.size ⇒ Object
A size label of the item
12400 12401 12402 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12400 def AttributeIntent.size @@_size ||= AttributeIntent.new('size') end |
.sku ⇒ Object
An SKU for the item
12405 12406 12407 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12405 def AttributeIntent.sku @@_sku ||= AttributeIntent.new('sku') end |
.taxability ⇒ Object
Identifies whether taxes are applicable to an item
12410 12411 12412 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12410 def AttributeIntent.taxability @@_taxability ||= AttributeIntent.new('taxability') end |
Instance Method Details
#to_hash ⇒ Object
12434 12435 12436 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12434 def to_hash value end |