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.



23852
23853
23854
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23852

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23850
23851
23852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23850

def value
  @value
end

Class Method Details

.allObject

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



23882
23883
23884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23882

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

.ALLObject



23872
23873
23874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23872

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



23857
23858
23859
23860
23861
23862
23863
23864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23857

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



23867
23868
23869
23870
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23867

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.



23877
23878
23879
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23877

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

Instance Method Details

#to_hashObject



23886
23887
23888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23886

def to_hash
  value
end