Class: Io::Flow::V0::Models::TaxabilityType
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TaxabilityType
- 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 TaxabilityType for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of TaxabilityType for this value, or nil if not found.
-
.tax_rule ⇒ Object
Rule indicating how taxes should be applied.
Instance Method Summary collapse
-
#initialize(value) ⇒ TaxabilityType
constructor
A new instance of TaxabilityType.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TaxabilityType
Returns a new instance of TaxabilityType.
10582 10583 10584 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10582 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10580 10581 10582 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10580 def value @value end |
Class Method Details
.ALL ⇒ Object
10602 10603 10604 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10602 def TaxabilityType.ALL @@all ||= [TaxabilityType.tax_rule] end |
.apply(value) ⇒ Object
Returns the instance of TaxabilityType for this value, creating a new instance for an unknown value
10587 10588 10589 10590 10591 10592 10593 10594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10587 def TaxabilityType.apply(value) if value.instance_of?(TaxabilityType) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TaxabilityType.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of TaxabilityType for this value, or nil if not found
10597 10598 10599 10600 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10597 def TaxabilityType.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TaxabilityType.ALL.find { |v| v.value == value } end |
.tax_rule ⇒ Object
Rule indicating how taxes should be applied. Acceptable values are defined by the ‘taxability_value’ enum.
10608 10609 10610 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10608 def TaxabilityType.tax_rule @@_tax_rule ||= TaxabilityType.new('tax_rule') end |
Instance Method Details
#to_hash ⇒ Object
10612 10613 10614 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10612 def to_hash value end |