class Strikeiron::Jurisdiction
Jurisdiction
represents a breakdown of the tax calculations for the taxable region(s).
Attributes¶ ↑
-
fips
- The code assigned by the Federal Government or state agencies to uniquely identify a location. -
name
- Name associated to the corresponding FIPS code. -
tax_amount
- Sales tax rate for the corresponding FIPS code.
Attributes
fips[RW]
name[RW]
tax_amount[RW]
Public Class Methods
from_soap(hash = {})
click to toggle source
Convert the SOAP response object to a Jurisdiction
# File lib/strikeiron2/jurisdiction.rb, line 22 def self.from_soap(hash = {}) default_values = { :fips => hash['FIPS'], :name => hash['Name'], :tax_amount => hash['SalesTaxAmount'] } new(default_values) end
new(default_values = {})
click to toggle source
Creates a Jurisdiction
with the supplied attributes.
# File lib/strikeiron2/jurisdiction.rb, line 12 def initialize(default_values = {}) safe_keys = %w(fips name tax_amount) default_values.each do |key, value| next unless safe_keys.include? key.to_s # Only permit the keys defined in safe_keys self.send "#{key}=", value end end