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.



25035
25036
25037
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25035

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



25033
25034
25035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25033

def value
  @value
end

Class Method Details

.allObject

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



25065
25066
25067
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25065

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

.ALLObject



25055
25056
25057
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25055

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



25040
25041
25042
25043
25044
25045
25046
25047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25040

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



25050
25051
25052
25053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25050

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.



25060
25061
25062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25060

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

Instance Method Details

#to_hashObject



25069
25070
25071
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25069

def to_hash
  value
end