Class: Io::Flow::V0::Models::TaxApplicability

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ TaxApplicability

Returns a new instance of TaxApplicability.



15772
15773
15774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15772

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15770
15771
15772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15770

def value
  @value
end

Class Method Details

.allObject

In all scenarios a customer should pay tax within the Flow system.



15802
15803
15804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15802

def TaxApplicability.all
  @@_all ||= TaxApplicability.new('all')
end

.ALLObject



15792
15793
15794
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15792

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



15777
15778
15779
15780
15781
15782
15783
15784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15777

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



15787
15788
15789
15790
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15787

def TaxApplicability.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  TaxApplicability.ALL.find { |v| v.value == value }
end

.noneObject

In no scenario should a customer pay tax within the Flow system.



15797
15798
15799
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15797

def TaxApplicability.none
  @@_none ||= TaxApplicability.new('none')
end

Instance Method Details

#to_hashObject



15806
15807
15808
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15806

def to_hash
  value
end