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.
7996 7997 7998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7996 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7994 7995 7996 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7994 def value @value end |
Class Method Details
.ALL ⇒ Object
8016 8017 8018 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8016 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
8001 8002 8003 8004 8005 8006 8007 8008 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8001 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)
8021 8022 8023 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8021 def AttributeIntent.brand @@_brand ||= AttributeIntent.new('brand') end |
.consumer_url ⇒ Object
A URL of the product detail page of the item
8063 8064 8065 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8063 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
8011 8012 8013 8014 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8011 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
8032 8033 8034 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8032 def AttributeIntent.fulfillment_method @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method') end |
.gtin ⇒ Object
The Global Trade Item Number of this item.
8068 8069 8070 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8068 def AttributeIntent.gtin @@_gtin ||= AttributeIntent.new('gtin') end |
.hazardous ⇒ Object
Identifies whether this item may contain hazardous materials
8037 8038 8039 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8037 def AttributeIntent.hazardous @@_hazardous ||= AttributeIntent.new('hazardous') end |
.mpn ⇒ Object
The Manufacturer Part Number of this item.
8073 8074 8075 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8073 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)
8043 8044 8045 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8043 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
8027 8028 8029 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8027 def AttributeIntent.product_id @@_product_id ||= AttributeIntent.new('product_id') end |
.size ⇒ Object
A size label of the item
8048 8049 8050 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8048 def AttributeIntent.size @@_size ||= AttributeIntent.new('size') end |
.sku ⇒ Object
An SKU for the item
8053 8054 8055 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8053 def AttributeIntent.sku @@_sku ||= AttributeIntent.new('sku') end |
.taxability ⇒ Object
Identifies whether taxes are applicable to an item
8058 8059 8060 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8058 def AttributeIntent.taxability @@_taxability ||= AttributeIntent.new('taxability') end |
Instance Method Details
#to_hash ⇒ Object
8077 8078 8079 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8077 def to_hash value end |