strikeiron 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,12 +1,8 @@
1
1
  language: ruby
2
- before_install:
3
- - gem update --system
4
- - gem install bundler --pre
5
2
  rvm:
6
3
  - 1.9.2
7
4
  - 1.9.3
5
+ - 1.8.7
8
6
  - jruby-19mode
9
- - jruby-head
10
- - rbx-18mode
11
- - rbx-19mode
7
+ - jruby-18mode
12
8
  script: rake test
@@ -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 => record[:jurisdictions][:sales_tax_value_jurisdiction].map { |j| Jurisdiction.new(:fips => j[:fips], :name => j[:name], :tax_amount => j[:sales_tax_amount].to_f) }
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(
@@ -1,3 +1,3 @@
1
1
  module Strikeiron
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-08-31 00:00:00.000000000 Z
12
+ date: 2012-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon