Class: Io::Flow::V0::Models::TaxApplicability
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TaxApplicability
- 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
In all scenarios a customer should pay tax within the Flow system.
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of TaxApplicability for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of TaxApplicability for this value, or nil if not found.
-
.none ⇒ Object
In no scenario should a customer pay tax within the Flow system.
Instance Method Summary collapse
-
#initialize(value) ⇒ TaxApplicability
constructor
A new instance of TaxApplicability.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ TaxApplicability
Returns a new instance of TaxApplicability.
18482 18483 18484 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18482 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18480 18481 18482 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18480 def value @value end |
Class Method Details
.all ⇒ Object
In all scenarios a customer should pay tax within the Flow system.
18512 18513 18514 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18512 def TaxApplicability.all @@_all ||= TaxApplicability.new('all') end |
.ALL ⇒ Object
18502 18503 18504 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18502 def TaxApplicability.ALL @@all ||= [TaxApplicability.none, TaxApplicability.all] end |
.apply(value) ⇒ Object
Returns the instance of TaxApplicability for this value, creating a new instance for an unknown value
18487 18488 18489 18490 18491 18492 18493 18494 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18487 def TaxApplicability.apply(value) if value.instance_of?(TaxApplicability) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || TaxApplicability.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of TaxApplicability for this value, or nil if not found
18497 18498 18499 18500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18497 def TaxApplicability.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) TaxApplicability.ALL.find { |v| v.value == value } end |
.none ⇒ Object
In no scenario should a customer pay tax within the Flow system.
18507 18508 18509 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18507 def TaxApplicability.none @@_none ||= TaxApplicability.new('none') end |
Instance Method Details
#to_hash ⇒ Object
18516 18517 18518 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18516 def to_hash value end |