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
Attributes with this data type imply that this is the brand name of the item for retailers that sell multiple brands.
-
.from_string(value) ⇒ Object
Returns the instance of AttributeIntent for this value, or nil if not found.
-
.fulfillment_method ⇒ Object
Attributes with this data type imply whether delivery is a package or digital good.
-
.hazardous ⇒ Object
Attributes with this data type imply whether this item may contain hazardous materials.
-
.price ⇒ Object
Attributes with this data type are inferred to be prices in the organization’s base currency and will be localized based on each Experience’s pricing policy.
-
.product_id ⇒ Object
Attributes with this data type imply that the value of this attribute identifies the product Id which can then be used to group multiple items together.
-
.size ⇒ Object
Attributes with this data type imply that that this is the clothing size of the item.
-
.sku ⇒ Object
Attributes with this data type imply that this is the retailers SKU for the item.
-
.taxability ⇒ Object
Attributes with this data type imply 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.
7969 7970 7971 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7969 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7967 7968 7969 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7967 def value @value end |
Class Method Details
.ALL ⇒ Object
7989 7990 7991 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7989 def AttributeIntent.ALL @@all ||= [AttributeIntent.brand, AttributeIntent.product_id, AttributeIntent.fulfillment_method, AttributeIntent.hazardous, AttributeIntent.price, AttributeIntent.size, AttributeIntent.sku, AttributeIntent.taxability] end |
.apply(value) ⇒ Object
Returns the instance of AttributeIntent for this value, creating a new instance for an unknown value
7974 7975 7976 7977 7978 7979 7980 7981 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7974 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
Attributes with this data type imply that this is the brand name of the item for retailers that sell multiple brands
7995 7996 7997 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7995 def AttributeIntent.brand @@_brand ||= AttributeIntent.new('brand') end |
.from_string(value) ⇒ Object
Returns the instance of AttributeIntent for this value, or nil if not found
7984 7985 7986 7987 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7984 def AttributeIntent.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AttributeIntent.ALL.find { |v| v.value == value } end |
.fulfillment_method ⇒ Object
Attributes with this data type imply whether delivery is a package or digital good.
8008 8009 8010 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8008 def AttributeIntent.fulfillment_method @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method') end |
.hazardous ⇒ Object
Attributes with this data type imply whether this item may contain hazardous materials.
8014 8015 8016 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8014 def AttributeIntent.hazardous @@_hazardous ||= AttributeIntent.new('hazardous') end |
.price ⇒ Object
Attributes with this data type are inferred to be prices in the organization’s base currency and will be localized based on each Experience’s pricing policy.
8020 8021 8022 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8020 def AttributeIntent.price @@_price ||= AttributeIntent.new('price') end |
.product_id ⇒ Object
Attributes with this data type imply that the value of this attribute identifies the product Id which can then be used to group multiple items together.
8002 8003 8004 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8002 def AttributeIntent.product_id @@_product_id ||= AttributeIntent.new('product_id') end |
.size ⇒ Object
Attributes with this data type imply that that this is the clothing size of the item.
8026 8027 8028 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8026 def AttributeIntent.size @@_size ||= AttributeIntent.new('size') end |
.sku ⇒ Object
Attributes with this data type imply that this is the retailers SKU for the item.
8032 8033 8034 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8032 def AttributeIntent.sku @@_sku ||= AttributeIntent.new('sku') end |
.taxability ⇒ Object
Attributes with this data type imply whether taxes are applicable to an item.
8037 8038 8039 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8037 def AttributeIntent.taxability @@_taxability ||= AttributeIntent.new('taxability') end |
Instance Method Details
#to_hash ⇒ Object
8041 8042 8043 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8041 def to_hash value end |