class Io::Flow::V0::Models::TaxabilityValue

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27459
def TaxabilityValue.ALL
  @@all ||= [TaxabilityValue.exempt]
end
apply(value) click to toggle source

Returns the instance of TaxabilityValue for this value, creating a new instance for an unknown value

# File lib/flow_commerce/flow_api_v0_client.rb, line 27444
def TaxabilityValue.apply(value)
  if value.instance_of?(TaxabilityValue)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || TaxabilityValue.new(value))
  end
end
exempt() click to toggle source

An item with this value is exempt from being taxed.

# File lib/flow_commerce/flow_api_v0_client.rb, line 27464
def TaxabilityValue.exempt
  @@_exempt ||= TaxabilityValue.new('exempt')
end
from_string(value) click to toggle source

Returns the instance of TaxabilityValue for this value, or nil if not found

# File lib/flow_commerce/flow_api_v0_client.rb, line 27454
def TaxabilityValue.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  TaxabilityValue.ALL.find { |v| v.value == value }
end
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27439
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 27468
def to_hash
  value
end