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.
-
.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.
-
.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.
6612 6613 6614 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6612 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6610 6611 6612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6610 def value @value end |
Class Method Details
.ALL ⇒ Object
6632 6633 6634 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6632 def AttributeIntent.ALL @@all ||= [AttributeIntent.fulfillment_method, AttributeIntent.price, AttributeIntent.taxability] end |
.apply(value) ⇒ Object
Returns the instance of AttributeIntent for this value, creating a new instance for an unknown value
6617 6618 6619 6620 6621 6622 6623 6624 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6617 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 |
.from_string(value) ⇒ Object
Returns the instance of AttributeIntent for this value, or nil if not found
6627 6628 6629 6630 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6627 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.
6638 6639 6640 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6638 def AttributeIntent.fulfillment_method @@_fulfillment_method ||= AttributeIntent.new('fulfillment_method') 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.
6644 6645 6646 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6644 def AttributeIntent.price @@_price ||= AttributeIntent.new('price') end |
.taxability ⇒ Object
Attributes with this data type imply whether taxes are applicable to an item.
6649 6650 6651 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6649 def AttributeIntent.taxability @@_taxability ||= AttributeIntent.new('taxability') end |
Instance Method Details
#to_hash ⇒ Object
6653 6654 6655 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6653 def to_hash value end |