docusign_esign 3.7.0.rc1 → 3.8.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -9
- data/docusign_esign-2.8.0.rc1.gem +0 -0
- data/lib/docusign_esign.rb +29 -1
- data/lib/docusign_esign/api/accounts_api.rb +65 -8
- data/lib/docusign_esign/api/bulk_envelopes_api.rb +22 -298
- data/lib/docusign_esign/api/connect_api.rb +196 -0
- data/lib/docusign_esign/api/envelopes_api.rb +1502 -78
- data/lib/docusign_esign/api/groups_api.rb +9 -9
- data/lib/docusign_esign/api/trust_service_providers_api.rb +232 -0
- data/lib/docusign_esign/api/users_api.rb +52 -0
- data/lib/docusign_esign/models/account_billing_plan.rb +11 -1
- data/lib/docusign_esign/models/account_information.rb +34 -4
- data/lib/docusign_esign/models/account_settings_information.rb +134 -1
- data/lib/docusign_esign/models/account_ui_settings.rb +20 -1
- data/lib/docusign_esign/models/bulk_send_batch_request.rb +184 -0
- data/lib/docusign_esign/models/bulk_send_batch_status.rb +21 -1
- data/lib/docusign_esign/models/complete_sign_hash_response.rb +7 -11
- data/lib/docusign_esign/models/complete_sign_request.rb +7 -11
- data/lib/docusign_esign/models/credential.rb +7 -11
- data/lib/docusign_esign/models/display_appliance_account.rb +224 -0
- data/lib/docusign_esign/models/display_appliance_info.rb +174 -0
- data/lib/docusign_esign/models/display_appliance_pdf.rb +174 -0
- data/lib/docusign_esign/models/display_appliance_signer_attachment.rb +174 -0
- data/lib/docusign_esign/models/document.rb +11 -1
- data/lib/docusign_esign/models/document_security_store.rb +7 -11
- data/lib/docusign_esign/models/document_update_info.rb +7 -11
- data/lib/docusign_esign/models/envelope_form_data.rb +13 -1
- data/lib/docusign_esign/models/external_claim.rb +7 -11
- data/lib/docusign_esign/models/group_brands.rb +207 -0
- data/lib/docusign_esign/models/payment_details.rb +10 -1
- data/lib/docusign_esign/models/payment_signer_values.rb +184 -0
- data/lib/docusign_esign/models/prefill_tabs.rb +222 -0
- data/lib/docusign_esign/models/revision.rb +7 -11
- data/lib/docusign_esign/models/seal.rb +8 -12
- data/lib/docusign_esign/models/sender.rb +7 -11
- data/lib/docusign_esign/models/sign_hash_document.rb +7 -11
- data/lib/docusign_esign/models/sign_hash_session_info_response.rb +7 -11
- data/lib/docusign_esign/models/sign_session_info_request.rb +7 -11
- data/lib/docusign_esign/models/signature_data_info.rb +7 -11
- data/lib/docusign_esign/models/signature_properties.rb +7 -11
- data/lib/docusign_esign/models/tab_account_settings.rb +20 -1
- data/lib/docusign_esign/models/tabs.rb +10 -1
- data/lib/docusign_esign/models/template_tabs.rb +10 -1
- data/lib/docusign_esign/models/time_stamp_field.rb +7 -11
- data/lib/docusign_esign/models/tsp_health_check_request.rb +7 -11
- data/lib/docusign_esign/models/tsp_health_check_status_description.rb +7 -11
- data/lib/docusign_esign/models/update_transaction_request.rb +7 -11
- data/lib/docusign_esign/models/update_transaction_response.rb +7 -11
- data/lib/docusign_esign/models/user.rb +7 -11
- data/lib/docusign_esign/models/user_info_response.rb +7 -11
- data/lib/docusign_esign/models/user_information.rb +11 -1
- data/lib/docusign_esign/version.rb +1 -1
- data/tests/Gemfile.lock +9 -5
- metadata +11 -2
@@ -53,6 +53,8 @@ module DocuSign_eSign
|
|
53
53
|
#
|
54
54
|
attr_accessor :payment_source_id
|
55
55
|
|
56
|
+
attr_accessor :signer_values
|
57
|
+
|
56
58
|
# Indicates the envelope status. Valid values are: * sent - The envelope is sent to the recipients. * created - The envelope is saved as a draft and can be modified and sent later.
|
57
59
|
attr_accessor :status
|
58
60
|
|
@@ -75,6 +77,7 @@ module DocuSign_eSign
|
|
75
77
|
:'line_items' => :'lineItems',
|
76
78
|
:'payment_option' => :'paymentOption',
|
77
79
|
:'payment_source_id' => :'paymentSourceId',
|
80
|
+
:'signer_values' => :'signerValues',
|
78
81
|
:'status' => :'status',
|
79
82
|
:'total' => :'total'
|
80
83
|
}
|
@@ -97,6 +100,7 @@ module DocuSign_eSign
|
|
97
100
|
:'line_items' => :'Array<PaymentLineItem>',
|
98
101
|
:'payment_option' => :'String',
|
99
102
|
:'payment_source_id' => :'String',
|
103
|
+
:'signer_values' => :'PaymentSignerValues',
|
100
104
|
:'status' => :'String',
|
101
105
|
:'total' => :'Money'
|
102
106
|
}
|
@@ -170,6 +174,10 @@ module DocuSign_eSign
|
|
170
174
|
self.payment_source_id = attributes[:'paymentSourceId']
|
171
175
|
end
|
172
176
|
|
177
|
+
if attributes.has_key?(:'signerValues')
|
178
|
+
self.signer_values = attributes[:'signerValues']
|
179
|
+
end
|
180
|
+
|
173
181
|
if attributes.has_key?(:'status')
|
174
182
|
self.status = attributes[:'status']
|
175
183
|
end
|
@@ -211,6 +219,7 @@ module DocuSign_eSign
|
|
211
219
|
line_items == o.line_items &&
|
212
220
|
payment_option == o.payment_option &&
|
213
221
|
payment_source_id == o.payment_source_id &&
|
222
|
+
signer_values == o.signer_values &&
|
214
223
|
status == o.status &&
|
215
224
|
total == o.total
|
216
225
|
end
|
@@ -224,7 +233,7 @@ module DocuSign_eSign
|
|
224
233
|
# Calculates hash code according to all attributes.
|
225
234
|
# @return [Fixnum] Hash code
|
226
235
|
def hash
|
227
|
-
[allowed_payment_methods, charge_id, currency_code, currency_code_metadata, customer_id, custom_metadata, custom_metadata_required, gateway_account_id, gateway_account_id_metadata, gateway_display_name, gateway_name, line_items, payment_option, payment_source_id, status, total].hash
|
236
|
+
[allowed_payment_methods, charge_id, currency_code, currency_code_metadata, customer_id, custom_metadata, custom_metadata_required, gateway_account_id, gateway_account_id_metadata, gateway_display_name, gateway_name, line_items, payment_option, payment_source_id, signer_values, status, total].hash
|
228
237
|
end
|
229
238
|
|
230
239
|
# Builds the object from hash
|
@@ -0,0 +1,184 @@
|
|
1
|
+
=begin
|
2
|
+
#DocuSign REST API
|
3
|
+
|
4
|
+
#The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
|
5
|
+
|
6
|
+
OpenAPI spec version: v2.1
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_eSign
|
15
|
+
class PaymentSignerValues
|
16
|
+
#
|
17
|
+
attr_accessor :payment_option
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'payment_option' => :'paymentOption'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'payment_option' => :'String'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'paymentOption')
|
42
|
+
self.payment_option = attributes[:'paymentOption']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
47
|
+
# @return Array for valid properties with the reasons
|
48
|
+
def list_invalid_properties
|
49
|
+
invalid_properties = Array.new
|
50
|
+
invalid_properties
|
51
|
+
end
|
52
|
+
|
53
|
+
# Check to see if the all the properties in the model are valid
|
54
|
+
# @return true if the model is valid
|
55
|
+
def valid?
|
56
|
+
true
|
57
|
+
end
|
58
|
+
|
59
|
+
# Checks equality by comparing each attribute.
|
60
|
+
# @param [Object] Object to be compared
|
61
|
+
def ==(o)
|
62
|
+
return true if self.equal?(o)
|
63
|
+
self.class == o.class &&
|
64
|
+
payment_option == o.payment_option
|
65
|
+
end
|
66
|
+
|
67
|
+
# @see the `==` method
|
68
|
+
# @param [Object] Object to be compared
|
69
|
+
def eql?(o)
|
70
|
+
self == o
|
71
|
+
end
|
72
|
+
|
73
|
+
# Calculates hash code according to all attributes.
|
74
|
+
# @return [Fixnum] Hash code
|
75
|
+
def hash
|
76
|
+
[payment_option].hash
|
77
|
+
end
|
78
|
+
|
79
|
+
# Builds the object from hash
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
81
|
+
# @return [Object] Returns the model itself
|
82
|
+
def build_from_hash(attributes)
|
83
|
+
return nil unless attributes.is_a?(Hash)
|
84
|
+
self.class.swagger_types.each_pair do |key, type|
|
85
|
+
if type =~ /\AArray<(.*)>/i
|
86
|
+
# check to ensure the input is an array given that the attribute
|
87
|
+
# is documented as an array but the input is not
|
88
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
89
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
90
|
+
end
|
91
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
92
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
93
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
94
|
+
end
|
95
|
+
|
96
|
+
self
|
97
|
+
end
|
98
|
+
|
99
|
+
# Deserializes the data based on type
|
100
|
+
# @param string type Data type
|
101
|
+
# @param string value Value to be deserialized
|
102
|
+
# @return [Object] Deserialized data
|
103
|
+
def _deserialize(type, value)
|
104
|
+
case type.to_sym
|
105
|
+
when :DateTime
|
106
|
+
DateTime.parse(value)
|
107
|
+
when :Date
|
108
|
+
Date.parse(value)
|
109
|
+
when :String
|
110
|
+
value.to_s
|
111
|
+
when :Integer
|
112
|
+
value.to_i
|
113
|
+
when :Float
|
114
|
+
value.to_f
|
115
|
+
when :BOOLEAN
|
116
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
117
|
+
true
|
118
|
+
else
|
119
|
+
false
|
120
|
+
end
|
121
|
+
when :Object
|
122
|
+
# generic object (usually a Hash), return directly
|
123
|
+
value
|
124
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
125
|
+
inner_type = Regexp.last_match[:inner_type]
|
126
|
+
value.map { |v| _deserialize(inner_type, v) }
|
127
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
128
|
+
k_type = Regexp.last_match[:k_type]
|
129
|
+
v_type = Regexp.last_match[:v_type]
|
130
|
+
{}.tap do |hash|
|
131
|
+
value.each do |k, v|
|
132
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
else # model
|
136
|
+
temp_model = DocuSign_eSign.const_get(type).new
|
137
|
+
temp_model.build_from_hash(value)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Returns the string representation of the object
|
142
|
+
# @return [String] String presentation of the object
|
143
|
+
def to_s
|
144
|
+
to_hash.to_s
|
145
|
+
end
|
146
|
+
|
147
|
+
# to_body is an alias to to_hash (backward compatibility)
|
148
|
+
# @return [Hash] Returns the object in the form of hash
|
149
|
+
def to_body
|
150
|
+
to_hash
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the object in the form of hash
|
154
|
+
# @return [Hash] Returns the object in the form of hash
|
155
|
+
def to_hash
|
156
|
+
hash = {}
|
157
|
+
self.class.attribute_map.each_pair do |attr, param|
|
158
|
+
value = self.send(attr)
|
159
|
+
next if value.nil?
|
160
|
+
hash[param] = _to_hash(value)
|
161
|
+
end
|
162
|
+
hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Outputs non-array value in the form of hash
|
166
|
+
# For object, use to_hash. Otherwise, just return the value
|
167
|
+
# @param [Object] value Any valid value
|
168
|
+
# @return [Hash] Returns the value in the form of hash
|
169
|
+
def _to_hash(value)
|
170
|
+
if value.is_a?(Array)
|
171
|
+
value.compact.map { |v| _to_hash(v) }
|
172
|
+
elsif value.is_a?(Hash)
|
173
|
+
{}.tap do |hash|
|
174
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
175
|
+
end
|
176
|
+
elsif value.respond_to? :to_hash
|
177
|
+
value.to_hash
|
178
|
+
else
|
179
|
+
value
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
end
|
184
|
+
end
|
@@ -0,0 +1,222 @@
|
|
1
|
+
=begin
|
2
|
+
#DocuSign REST API
|
3
|
+
|
4
|
+
#The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
|
5
|
+
|
6
|
+
OpenAPI spec version: v2.1
|
7
|
+
Contact: devcenter@docusign.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require 'date'
|
13
|
+
|
14
|
+
module DocuSign_eSign
|
15
|
+
class PrefillTabs
|
16
|
+
# Specifies a tag on the document in a location where the recipient can select an option.
|
17
|
+
attr_accessor :checkbox_tabs
|
18
|
+
|
19
|
+
# Specifies a tag on the document in a location where the recipient can select one option from a group of options using a radio button. The radio buttons do not have to be on the same page in a document.
|
20
|
+
attr_accessor :radio_group_tabs
|
21
|
+
|
22
|
+
#
|
23
|
+
attr_accessor :tab_groups
|
24
|
+
|
25
|
+
# Specifies a that that is an adaptable field that allows the recipient to enter different text information. When getting information that includes this tab type, the original value of the tab when the associated envelope was sent is included in the response.
|
26
|
+
attr_accessor :text_tabs
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'checkbox_tabs' => :'checkboxTabs',
|
32
|
+
:'radio_group_tabs' => :'radioGroupTabs',
|
33
|
+
:'tab_groups' => :'tabGroups',
|
34
|
+
:'text_tabs' => :'textTabs'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'checkbox_tabs' => :'Array<Checkbox>',
|
42
|
+
:'radio_group_tabs' => :'Array<RadioGroup>',
|
43
|
+
:'tab_groups' => :'Array<TabGroup>',
|
44
|
+
:'text_tabs' => :'Array<Text>'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Initializes the object
|
49
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
50
|
+
def initialize(attributes = {})
|
51
|
+
return unless attributes.is_a?(Hash)
|
52
|
+
|
53
|
+
# convert string to symbol for hash key
|
54
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
55
|
+
|
56
|
+
if attributes.has_key?(:'checkboxTabs')
|
57
|
+
if (value = attributes[:'checkboxTabs']).is_a?(Array)
|
58
|
+
self.checkbox_tabs = value
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.has_key?(:'radioGroupTabs')
|
63
|
+
if (value = attributes[:'radioGroupTabs']).is_a?(Array)
|
64
|
+
self.radio_group_tabs = value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.has_key?(:'tabGroups')
|
69
|
+
if (value = attributes[:'tabGroups']).is_a?(Array)
|
70
|
+
self.tab_groups = value
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes.has_key?(:'textTabs')
|
75
|
+
if (value = attributes[:'textTabs']).is_a?(Array)
|
76
|
+
self.text_tabs = value
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
+
# @return Array for valid properties with the reasons
|
83
|
+
def list_invalid_properties
|
84
|
+
invalid_properties = Array.new
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
true
|
92
|
+
end
|
93
|
+
|
94
|
+
# Checks equality by comparing each attribute.
|
95
|
+
# @param [Object] Object to be compared
|
96
|
+
def ==(o)
|
97
|
+
return true if self.equal?(o)
|
98
|
+
self.class == o.class &&
|
99
|
+
checkbox_tabs == o.checkbox_tabs &&
|
100
|
+
radio_group_tabs == o.radio_group_tabs &&
|
101
|
+
tab_groups == o.tab_groups &&
|
102
|
+
text_tabs == o.text_tabs
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Fixnum] Hash code
|
113
|
+
def hash
|
114
|
+
[checkbox_tabs, radio_group_tabs, tab_groups, text_tabs].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def build_from_hash(attributes)
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
122
|
+
self.class.swagger_types.each_pair do |key, type|
|
123
|
+
if type =~ /\AArray<(.*)>/i
|
124
|
+
# check to ensure the input is an array given that the attribute
|
125
|
+
# is documented as an array but the input is not
|
126
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
127
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
128
|
+
end
|
129
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
130
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
131
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
132
|
+
end
|
133
|
+
|
134
|
+
self
|
135
|
+
end
|
136
|
+
|
137
|
+
# Deserializes the data based on type
|
138
|
+
# @param string type Data type
|
139
|
+
# @param string value Value to be deserialized
|
140
|
+
# @return [Object] Deserialized data
|
141
|
+
def _deserialize(type, value)
|
142
|
+
case type.to_sym
|
143
|
+
when :DateTime
|
144
|
+
DateTime.parse(value)
|
145
|
+
when :Date
|
146
|
+
Date.parse(value)
|
147
|
+
when :String
|
148
|
+
value.to_s
|
149
|
+
when :Integer
|
150
|
+
value.to_i
|
151
|
+
when :Float
|
152
|
+
value.to_f
|
153
|
+
when :BOOLEAN
|
154
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
155
|
+
true
|
156
|
+
else
|
157
|
+
false
|
158
|
+
end
|
159
|
+
when :Object
|
160
|
+
# generic object (usually a Hash), return directly
|
161
|
+
value
|
162
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
163
|
+
inner_type = Regexp.last_match[:inner_type]
|
164
|
+
value.map { |v| _deserialize(inner_type, v) }
|
165
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
166
|
+
k_type = Regexp.last_match[:k_type]
|
167
|
+
v_type = Regexp.last_match[:v_type]
|
168
|
+
{}.tap do |hash|
|
169
|
+
value.each do |k, v|
|
170
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
else # model
|
174
|
+
temp_model = DocuSign_eSign.const_get(type).new
|
175
|
+
temp_model.build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
next if value.nil?
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
end
|