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.
-
.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.
7416 7417 7418 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7416 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7414 7415 7416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7414 def value @value end |
Class Method Details
.ALL ⇒ Object
7436 7437 7438 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7436 def AttributeIntent.ALL @@all ||= [AttributeIntent.brand, AttributeIntent.fulfillment_method, AttributeIntent.hazardous, AttributeIntent.price, AttributeIntent.taxability] end |
.apply(value) ⇒ Object
Returns the instance of AttributeIntent for this value, creating a new instance for an unknown value
7421 7422 7423 7424 7425 7426 7427 7428 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7421 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
7442 7443 7444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7442 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
7431 7432 7433 7434 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7431 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.
7448 7449 7450 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7448 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.
7454 7455 7456 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7454 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.
7460 7461 7462 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7460 def AttributeIntent.price @@_price ||= AttributeIntent.new('price') end |
.taxability ⇒ Object
Attributes with this data type imply whether taxes are applicable to an item.
7465 7466 7467 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7465 def AttributeIntent.taxability @@_taxability ||= AttributeIntent.new('taxability') end |
Instance Method Details
#to_hash ⇒ Object
7469 7470 7471 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7469 def to_hash value end |