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.
16320 16321 16322 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16320 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16318 16319 16320 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16318 def value @value end |
Class Method Details
.all ⇒ Object
In all scenarios a customer should pay tax within the Flow system.
16350 16351 16352 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16350 def TaxApplicability.all @@_all ||= TaxApplicability.new('all') end |
.ALL ⇒ Object
16340 16341 16342 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16340 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
16325 16326 16327 16328 16329 16330 16331 16332 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16325 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
16335 16336 16337 16338 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16335 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.
16345 16346 16347 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16345 def TaxApplicability.none @@_none ||= TaxApplicability.new('none') end |
Instance Method Details
#to_hash ⇒ Object
16354 16355 16356 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16354 def to_hash value end |