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.
20490 20491 20492 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20490 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
20488 20489 20490 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20488 def value @value end |
Class Method Details
.ALL ⇒ Object
20510 20511 20512 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20510 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
20495 20496 20497 20498 20499 20500 20501 20502 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20495 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
20505 20506 20507 20508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20505 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.
20516 20517 20518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20516 def TaxabilityType.tax_rule @@_tax_rule ||= TaxabilityType.new('tax_rule') end |
Instance Method Details
#to_hash ⇒ Object
20520 20521 20522 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20520 def to_hash value end |