strikeiron 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +2 -6
- data/lib/strikeiron/tax_result.rb +8 -13
- data/lib/strikeiron/version.rb +1 -1
- metadata +2 -2
data/.travis.yml
CHANGED
@@ -17,25 +17,20 @@ module Strikeiron #:nodoc:
|
|
17
17
|
class << self
|
18
18
|
# Convert the object from the Strikeiron response
|
19
19
|
def from_soap(response)
|
20
|
-
tax_values
|
20
|
+
tax_values = []
|
21
|
+
response_records = response[:results][:tax_value_record]
|
22
|
+
response_records = [ response_records ] if response_records.is_a?(Hash)
|
23
|
+
|
24
|
+
response_records.each do |record|
|
25
|
+
jurisdictions = record[:jurisdictions][:sales_tax_value_jurisdiction]
|
26
|
+
jurisdictions = [ jurisdictions ] if jurisdictions.is_a?(Hash)
|
21
27
|
|
22
|
-
if response[:results][:tax_value_record].is_a?(Hash)
|
23
|
-
record = response[:results][:tax_value_record]
|
24
28
|
tax_values << TaxValue.new(
|
25
29
|
:category => record[:category],
|
26
30
|
:category_id => record[:category_id],
|
27
31
|
:tax_amount => record[:sales_tax_amount].to_f,
|
28
|
-
:jurisdictions =>
|
32
|
+
:jurisdictions => jurisdictions.map { |j| Jurisdiction.new(:fips => j[:fips], :name => j[:name], :tax_amount => j[:sales_tax_amount].to_f) }
|
29
33
|
)
|
30
|
-
else
|
31
|
-
response[:results][:tax_value_record].each do |record|
|
32
|
-
tax_values << TaxValue.new(
|
33
|
-
:category => record[:category],
|
34
|
-
:category_id => record[:category_id],
|
35
|
-
:tax_amount => record[:sales_tax_amount].to_f,
|
36
|
-
:jurisdictions => record[:jurisdictions][:sales_tax_value_jurisdiction].map { |j| Jurisdiction.new(:fips => j[:fips], :name => j[:name], :tax_amount => j[:sales_tax_amount].to_f) }
|
37
|
-
)
|
38
|
-
end
|
39
34
|
end
|
40
35
|
|
41
36
|
new(
|
data/lib/strikeiron/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: strikeiron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: savon
|