taxamo 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/LICENSE +11 -0
- data/README.md +120 -0
- data/Rakefile +7 -0
- data/lib/monkey.rb +90 -0
- data/lib/swagger.rb +93 -0
- data/lib/swagger/configuration.rb +21 -0
- data/lib/swagger/request.rb +198 -0
- data/lib/swagger/response.rb +87 -0
- data/lib/taxamo.rb +999 -0
- data/lib/taxamo/models/additionalcurrencies.rb +62 -0
- data/lib/taxamo/models/additionalcurrency.rb +82 -0
- data/lib/taxamo/models/bycountry.rb +77 -0
- data/lib/taxamo/models/bystatus.rb +69 -0
- data/lib/taxamo/models/bytaxationtype.rb +82 -0
- data/lib/taxamo/models/c.rb +77 -0
- data/lib/taxamo/models/calculatesimpletaxout.rb +62 -0
- data/lib/taxamo/models/calculatetaxin.rb +62 -0
- data/lib/taxamo/models/calculatetaxlocationout.rb +97 -0
- data/lib/taxamo/models/calculatetaxout.rb +62 -0
- data/lib/taxamo/models/canceltransactionout.rb +62 -0
- data/lib/taxamo/models/capturepaymentout.rb +62 -0
- data/lib/taxamo/models/confirmtransactionin.rb +62 -0
- data/lib/taxamo/models/confirmtransactionout.rb +62 -0
- data/lib/taxamo/models/countries.rb +112 -0
- data/lib/taxamo/models/country.rb +114 -0
- data/lib/taxamo/models/countryschema.rb +114 -0
- data/lib/taxamo/models/createpaymentin.rb +72 -0
- data/lib/taxamo/models/createpaymentout.rb +62 -0
- data/lib/taxamo/models/createrefundin.rb +77 -0
- data/lib/taxamo/models/createrefundout.rb +77 -0
- data/lib/taxamo/models/createsmstokenin.rb +67 -0
- data/lib/taxamo/models/createsmstokenout.rb +62 -0
- data/lib/taxamo/models/createtransactionin.rb +67 -0
- data/lib/taxamo/models/createtransactionout.rb +62 -0
- data/lib/taxamo/models/currencyschema.rb +82 -0
- data/lib/taxamo/models/customfields.rb +67 -0
- data/lib/taxamo/models/emailinvoicein.rb +62 -0
- data/lib/taxamo/models/emailinvoiceout.rb +62 -0
- data/lib/taxamo/models/evidence.rb +112 -0
- data/lib/taxamo/models/evidenceschema.rb +77 -0
- data/lib/taxamo/models/getcountriesdictout.rb +63 -0
- data/lib/taxamo/models/getcurrenciesdictout.rb +63 -0
- data/lib/taxamo/models/getdailysettlementstatsout.rb +63 -0
- data/lib/taxamo/models/getproducttypesdictout.rb +63 -0
- data/lib/taxamo/models/getrefundsout.rb +63 -0
- data/lib/taxamo/models/getsettlementout.rb +83 -0
- data/lib/taxamo/models/getsettlementstatsbycountryout.rb +63 -0
- data/lib/taxamo/models/getsettlementstatsbytaxationtypeout.rb +62 -0
- data/lib/taxamo/models/getsettlementsummaryout.rb +62 -0
- data/lib/taxamo/models/gettransactionout.rb +62 -0
- data/lib/taxamo/models/gettransactionsstatsout.rb +62 -0
- data/lib/taxamo/models/inputtransaction.rb +184 -0
- data/lib/taxamo/models/inputtransactionline.rb +133 -0
- data/lib/taxamo/models/inputtransactionupdate.rb +184 -0
- data/lib/taxamo/models/invoiceaddress.rb +97 -0
- data/lib/taxamo/models/listpaymentsout.rb +63 -0
- data/lib/taxamo/models/listtransactionsout.rb +63 -0
- data/lib/taxamo/models/locategivenipout.rb +72 -0
- data/lib/taxamo/models/locatemyipout.rb +72 -0
- data/lib/taxamo/models/n.rb +77 -0
- data/lib/taxamo/models/payments.rb +72 -0
- data/lib/taxamo/models/producttypeschema.rb +62 -0
- data/lib/taxamo/models/report.rb +92 -0
- data/lib/taxamo/models/settlementdailystatsschema.rb +102 -0
- data/lib/taxamo/models/summary.rb +87 -0
- data/lib/taxamo/models/transaction.rb +279 -0
- data/lib/taxamo/models/transactionlines.rb +163 -0
- data/lib/taxamo/models/transactions.rb +279 -0
- data/lib/taxamo/models/unconfirmtransactionin.rb +62 -0
- data/lib/taxamo/models/unconfirmtransactionout.rb +62 -0
- data/lib/taxamo/models/updatetransactionin.rb +62 -0
- data/lib/taxamo/models/updatetransactionout.rb +62 -0
- data/lib/taxamo/models/validatetaxnumberout.rb +77 -0
- data/lib/taxamo/models/verifysmstokenout.rb +62 -0
- data/lib/taxamo/version.rb +17 -0
- data/taxamo.gemspec +31 -0
- data/test/taxamo/connectivity_test.rb +55 -0
- data/test/taxamo/tax_test.rb +147 -0
- data/test/taxamo/transactions_api_test.rb +308 -0
- metadata +226 -0
@@ -0,0 +1,62 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class ConfirmTransactionOut
|
14
|
+
attr_accessor :transaction
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:transaction => :transaction
|
20
|
+
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(attributes = {})
|
25
|
+
return if attributes.empty?
|
26
|
+
# Morph attribute keys into undescored rubyish style
|
27
|
+
if attributes["transaction"]
|
28
|
+
@transaction = Transaction.new(attributes["transaction"])
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_body
|
36
|
+
body = {}
|
37
|
+
self.class.attribute_map.each_pair do |key, value|
|
38
|
+
v = self.send(key)
|
39
|
+
unless v.nil?
|
40
|
+
if v.is_a?(Array)
|
41
|
+
array = Array.new
|
42
|
+
v.each do |item|
|
43
|
+
if item.respond_to?("to_body".to_sym)
|
44
|
+
array.push item.to_body
|
45
|
+
else
|
46
|
+
array.push item
|
47
|
+
end
|
48
|
+
end
|
49
|
+
body[value] = array
|
50
|
+
else
|
51
|
+
if v.respond_to?("to_body".to_sym)
|
52
|
+
body[value] = v.to_body
|
53
|
+
else
|
54
|
+
body[value] = v
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
body
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class Countries
|
14
|
+
attr_accessor :by_token, :by_cc, :by_2003_rules, :forced, :by_ip, :guessed_from_ip, :other_commercially_relevant_info, :by_billing, :by_tax_number, :detected, :self_declaration
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:by_token => :by_token,
|
20
|
+
:by_cc => :by_cc,
|
21
|
+
:by_2003_rules => :by_2003_rules,
|
22
|
+
:forced => :forced,
|
23
|
+
:by_ip => :by_ip,
|
24
|
+
:guessed_from_ip => :guessed_from_ip,
|
25
|
+
:other_commercially_relevant_info => :other_commercially_relevant_info,
|
26
|
+
:by_billing => :by_billing,
|
27
|
+
:by_tax_number => :by_tax_number,
|
28
|
+
:detected => :detected,
|
29
|
+
:self_declaration => :self_declaration
|
30
|
+
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize(attributes = {})
|
35
|
+
return if attributes.empty?
|
36
|
+
# Morph attribute keys into undescored rubyish style
|
37
|
+
if attributes["by_token"]
|
38
|
+
@by_token = CountrySchema.new(attributes["by_token"])
|
39
|
+
|
40
|
+
end
|
41
|
+
if attributes["by_cc"]
|
42
|
+
@by_cc = CountrySchema.new(attributes["by_cc"])
|
43
|
+
|
44
|
+
end
|
45
|
+
if attributes["by_2003_rules"]
|
46
|
+
@by_2003_rules = CountrySchema.new(attributes["by_2003_rules"])
|
47
|
+
|
48
|
+
end
|
49
|
+
if attributes["forced"]
|
50
|
+
@forced = CountrySchema.new(attributes["forced"])
|
51
|
+
|
52
|
+
end
|
53
|
+
if attributes["by_ip"]
|
54
|
+
@by_ip = CountrySchema.new(attributes["by_ip"])
|
55
|
+
|
56
|
+
end
|
57
|
+
if attributes["guessed_from_ip"]
|
58
|
+
@guessed_from_ip = CountrySchema.new(attributes["guessed_from_ip"])
|
59
|
+
|
60
|
+
end
|
61
|
+
if attributes["other_commercially_relevant_info"]
|
62
|
+
@other_commercially_relevant_info = CountrySchema.new(attributes["other_commercially_relevant_info"])
|
63
|
+
|
64
|
+
end
|
65
|
+
if attributes["by_billing"]
|
66
|
+
@by_billing = CountrySchema.new(attributes["by_billing"])
|
67
|
+
|
68
|
+
end
|
69
|
+
if attributes["by_tax_number"]
|
70
|
+
@by_tax_number = CountrySchema.new(attributes["by_tax_number"])
|
71
|
+
|
72
|
+
end
|
73
|
+
if attributes["detected"]
|
74
|
+
@detected = CountrySchema.new(attributes["detected"])
|
75
|
+
|
76
|
+
end
|
77
|
+
if attributes["self_declaration"]
|
78
|
+
@self_declaration = CountrySchema.new(attributes["self_declaration"])
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
def to_body
|
86
|
+
body = {}
|
87
|
+
self.class.attribute_map.each_pair do |key, value|
|
88
|
+
v = self.send(key)
|
89
|
+
unless v.nil?
|
90
|
+
if v.is_a?(Array)
|
91
|
+
array = Array.new
|
92
|
+
v.each do |item|
|
93
|
+
if item.respond_to?("to_body".to_sym)
|
94
|
+
array.push item.to_body
|
95
|
+
else
|
96
|
+
array.push item
|
97
|
+
end
|
98
|
+
end
|
99
|
+
body[value] = array
|
100
|
+
else
|
101
|
+
if v.respond_to?("to_body".to_sym)
|
102
|
+
body[value] = v.to_body
|
103
|
+
else
|
104
|
+
body[value] = v
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
body
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class Country
|
14
|
+
attr_accessor :code_long, :codenum, :currency, :tax_supported, :name, :ccn3, :cca3, :calling_code, :tax_number_country_code, :code, :cca2
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:code_long => :code_long,
|
20
|
+
:codenum => :codenum,
|
21
|
+
:currency => :currency,
|
22
|
+
:tax_supported => :tax_supported,
|
23
|
+
:name => :name,
|
24
|
+
:ccn3 => :ccn3,
|
25
|
+
:cca3 => :cca3,
|
26
|
+
:calling_code => :callingCode,
|
27
|
+
:tax_number_country_code => :tax_number_country_code,
|
28
|
+
:code => :code,
|
29
|
+
:cca2 => :cca2
|
30
|
+
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize(attributes = {})
|
35
|
+
return if attributes.empty?
|
36
|
+
# Morph attribute keys into undescored rubyish style
|
37
|
+
if attributes["code_long"]
|
38
|
+
@code_long = attributes["code_long"]
|
39
|
+
|
40
|
+
end
|
41
|
+
if attributes["codenum"]
|
42
|
+
@codenum = attributes["codenum"]
|
43
|
+
|
44
|
+
end
|
45
|
+
if attributes["currency"]
|
46
|
+
if (value = attributes["currency"]).is_a?(Array)
|
47
|
+
@currency = value
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if attributes["tax_supported"]
|
51
|
+
@tax_supported = attributes["tax_supported"]
|
52
|
+
|
53
|
+
end
|
54
|
+
if attributes["name"]
|
55
|
+
@name = attributes["name"]
|
56
|
+
|
57
|
+
end
|
58
|
+
if attributes["ccn3"]
|
59
|
+
@ccn3 = attributes["ccn3"]
|
60
|
+
|
61
|
+
end
|
62
|
+
if attributes["cca3"]
|
63
|
+
@cca3 = attributes["cca3"]
|
64
|
+
|
65
|
+
end
|
66
|
+
if attributes["calling_code"]
|
67
|
+
if (value = attributes["callingCode"]).is_a?(Array)
|
68
|
+
@calling_code = value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
if attributes["tax_number_country_code"]
|
72
|
+
@tax_number_country_code = attributes["tax_number_country_code"]
|
73
|
+
|
74
|
+
end
|
75
|
+
if attributes["code"]
|
76
|
+
@code = attributes["code"]
|
77
|
+
|
78
|
+
end
|
79
|
+
if attributes["cca2"]
|
80
|
+
@cca2 = attributes["cca2"]
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
def to_body
|
88
|
+
body = {}
|
89
|
+
self.class.attribute_map.each_pair do |key, value|
|
90
|
+
v = self.send(key)
|
91
|
+
unless v.nil?
|
92
|
+
if v.is_a?(Array)
|
93
|
+
array = Array.new
|
94
|
+
v.each do |item|
|
95
|
+
if item.respond_to?("to_body".to_sym)
|
96
|
+
array.push item.to_body
|
97
|
+
else
|
98
|
+
array.push item
|
99
|
+
end
|
100
|
+
end
|
101
|
+
body[value] = array
|
102
|
+
else
|
103
|
+
if v.respond_to?("to_body".to_sym)
|
104
|
+
body[value] = v.to_body
|
105
|
+
else
|
106
|
+
body[value] = v
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
body
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class CountrySchema
|
14
|
+
attr_accessor :code_long, :codenum, :currency, :tax_supported, :name, :ccn3, :cca3, :calling_code, :tax_number_country_code, :code, :cca2
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:code_long => :code_long,
|
20
|
+
:codenum => :codenum,
|
21
|
+
:currency => :currency,
|
22
|
+
:tax_supported => :tax_supported,
|
23
|
+
:name => :name,
|
24
|
+
:ccn3 => :ccn3,
|
25
|
+
:cca3 => :cca3,
|
26
|
+
:calling_code => :callingCode,
|
27
|
+
:tax_number_country_code => :tax_number_country_code,
|
28
|
+
:code => :code,
|
29
|
+
:cca2 => :cca2
|
30
|
+
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def initialize(attributes = {})
|
35
|
+
return if attributes.empty?
|
36
|
+
# Morph attribute keys into undescored rubyish style
|
37
|
+
if attributes["code_long"]
|
38
|
+
@code_long = attributes["code_long"]
|
39
|
+
|
40
|
+
end
|
41
|
+
if attributes["codenum"]
|
42
|
+
@codenum = attributes["codenum"]
|
43
|
+
|
44
|
+
end
|
45
|
+
if attributes["currency"]
|
46
|
+
if (value = attributes["currency"]).is_a?(Array)
|
47
|
+
@currency = value
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if attributes["tax_supported"]
|
51
|
+
@tax_supported = attributes["tax_supported"]
|
52
|
+
|
53
|
+
end
|
54
|
+
if attributes["name"]
|
55
|
+
@name = attributes["name"]
|
56
|
+
|
57
|
+
end
|
58
|
+
if attributes["ccn3"]
|
59
|
+
@ccn3 = attributes["ccn3"]
|
60
|
+
|
61
|
+
end
|
62
|
+
if attributes["cca3"]
|
63
|
+
@cca3 = attributes["cca3"]
|
64
|
+
|
65
|
+
end
|
66
|
+
if attributes["calling_code"]
|
67
|
+
if (value = attributes["callingCode"]).is_a?(Array)
|
68
|
+
@calling_code = value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
if attributes["tax_number_country_code"]
|
72
|
+
@tax_number_country_code = attributes["tax_number_country_code"]
|
73
|
+
|
74
|
+
end
|
75
|
+
if attributes["code"]
|
76
|
+
@code = attributes["code"]
|
77
|
+
|
78
|
+
end
|
79
|
+
if attributes["cca2"]
|
80
|
+
@cca2 = attributes["cca2"]
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
def to_body
|
88
|
+
body = {}
|
89
|
+
self.class.attribute_map.each_pair do |key, value|
|
90
|
+
v = self.send(key)
|
91
|
+
unless v.nil?
|
92
|
+
if v.is_a?(Array)
|
93
|
+
array = Array.new
|
94
|
+
v.each do |item|
|
95
|
+
if item.respond_to?("to_body".to_sym)
|
96
|
+
array.push item.to_body
|
97
|
+
else
|
98
|
+
array.push item
|
99
|
+
end
|
100
|
+
end
|
101
|
+
body[value] = array
|
102
|
+
else
|
103
|
+
if v.respond_to?("to_body".to_sym)
|
104
|
+
body[value] = v.to_body
|
105
|
+
else
|
106
|
+
body[value] = v
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
body
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# Copyright 2014-2015 Taxamo, Ltd.
|
2
|
+
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
9
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
10
|
+
# See the License for the specific language governing permissions and
|
11
|
+
# limitations under the License.
|
12
|
+
|
13
|
+
class CreatePaymentIn
|
14
|
+
attr_accessor :amount, :payment_timestamp, :payment_information
|
15
|
+
|
16
|
+
# :internal => :external
|
17
|
+
def self.attribute_map
|
18
|
+
{
|
19
|
+
:amount => :amount,
|
20
|
+
:payment_timestamp => :payment_timestamp,
|
21
|
+
:payment_information => :payment_information
|
22
|
+
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def initialize(attributes = {})
|
27
|
+
return if attributes.empty?
|
28
|
+
# Morph attribute keys into undescored rubyish style
|
29
|
+
if attributes["amount"]
|
30
|
+
@amount = attributes["amount"]
|
31
|
+
|
32
|
+
end
|
33
|
+
if attributes["payment_timestamp"]
|
34
|
+
@payment_timestamp = attributes["payment_timestamp"]
|
35
|
+
|
36
|
+
end
|
37
|
+
if attributes["payment_information"]
|
38
|
+
@payment_information = attributes["payment_information"]
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_body
|
46
|
+
body = {}
|
47
|
+
self.class.attribute_map.each_pair do |key, value|
|
48
|
+
v = self.send(key)
|
49
|
+
unless v.nil?
|
50
|
+
if v.is_a?(Array)
|
51
|
+
array = Array.new
|
52
|
+
v.each do |item|
|
53
|
+
if item.respond_to?("to_body".to_sym)
|
54
|
+
array.push item.to_body
|
55
|
+
else
|
56
|
+
array.push item
|
57
|
+
end
|
58
|
+
end
|
59
|
+
body[value] = array
|
60
|
+
else
|
61
|
+
if v.respond_to?("to_body".to_sym)
|
62
|
+
body[value] = v.to_body
|
63
|
+
else
|
64
|
+
body[value] = v
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
body
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|