trulioo_sdk 1.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.
Files changed (92) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +155 -0
  3. data/docs/Address.md +44 -0
  4. data/docs/AppendedField.md +20 -0
  5. data/docs/Business.md +36 -0
  6. data/docs/BusinessApi.md +155 -0
  7. data/docs/BusinessRecord.md +24 -0
  8. data/docs/BusinessRegistrationNumber.md +30 -0
  9. data/docs/BusinessRegistrationNumberMask.md +22 -0
  10. data/docs/BusinessResult.md +22 -0
  11. data/docs/BusinessSearchRequest.md +28 -0
  12. data/docs/BusinessSearchRequestBusinessSearchModel.md +26 -0
  13. data/docs/BusinessSearchResponse.md +28 -0
  14. data/docs/BusinessSearchResponseIndustryCode.md +20 -0
  15. data/docs/Communication.md +24 -0
  16. data/docs/ConfigurationApi.md +761 -0
  17. data/docs/ConnectionApi.md +213 -0
  18. data/docs/Consent.md +22 -0
  19. data/docs/CountrySubdivision.md +22 -0
  20. data/docs/DataField.md +22 -0
  21. data/docs/DataFields.md +34 -0
  22. data/docs/DatasourceField.md +24 -0
  23. data/docs/DatasourceResult.md +28 -0
  24. data/docs/Document.md +28 -0
  25. data/docs/DriverLicence.md +26 -0
  26. data/docs/Location.md +42 -0
  27. data/docs/LocationAdditionalFields.md +18 -0
  28. data/docs/NationalId.md +28 -0
  29. data/docs/NormalizedDatasourceField.md +20 -0
  30. data/docs/NormalizedDatasourceGroupCountry.md +34 -0
  31. data/docs/Passport.md +28 -0
  32. data/docs/PersonInfo.md +38 -0
  33. data/docs/PersonInfoAdditionalFields.md +18 -0
  34. data/docs/Record.md +26 -0
  35. data/docs/RecordRule.md +20 -0
  36. data/docs/Result.md +62 -0
  37. data/docs/ServiceError.md +20 -0
  38. data/docs/TestEntityDataFields.md +36 -0
  39. data/docs/TransactionRecordResult.md +32 -0
  40. data/docs/TransactionRecordResultAllOf.md +18 -0
  41. data/docs/TransactionStatus.md +26 -0
  42. data/docs/VerificationsApi.md +529 -0
  43. data/docs/VerifyRequest.md +38 -0
  44. data/docs/VerifyResult.md +30 -0
  45. data/lib/trulioo_sdk.rb +77 -0
  46. data/lib/trulioo_sdk/api/business_api.rb +158 -0
  47. data/lib/trulioo_sdk/api/configuration_api.rb +750 -0
  48. data/lib/trulioo_sdk/api/connection_api.rb +221 -0
  49. data/lib/trulioo_sdk/api/verifications_api.rb +515 -0
  50. data/lib/trulioo_sdk/api_client.rb +391 -0
  51. data/lib/trulioo_sdk/api_error.rb +53 -0
  52. data/lib/trulioo_sdk/configuration.rb +268 -0
  53. data/lib/trulioo_sdk/models/address.rb +356 -0
  54. data/lib/trulioo_sdk/models/appended_field.rb +237 -0
  55. data/lib/trulioo_sdk/models/business.rb +318 -0
  56. data/lib/trulioo_sdk/models/business_record.rb +261 -0
  57. data/lib/trulioo_sdk/models/business_registration_number.rb +410 -0
  58. data/lib/trulioo_sdk/models/business_registration_number_mask.rb +272 -0
  59. data/lib/trulioo_sdk/models/business_result.rb +249 -0
  60. data/lib/trulioo_sdk/models/business_search_request.rb +306 -0
  61. data/lib/trulioo_sdk/models/business_search_request_business_search_model.rb +364 -0
  62. data/lib/trulioo_sdk/models/business_search_response.rb +279 -0
  63. data/lib/trulioo_sdk/models/business_search_response_industry_code.rb +236 -0
  64. data/lib/trulioo_sdk/models/communication.rb +354 -0
  65. data/lib/trulioo_sdk/models/consent.rb +249 -0
  66. data/lib/trulioo_sdk/models/country_subdivision.rb +320 -0
  67. data/lib/trulioo_sdk/models/data_field.rb +245 -0
  68. data/lib/trulioo_sdk/models/data_fields.rb +306 -0
  69. data/lib/trulioo_sdk/models/datasource_field.rb +254 -0
  70. data/lib/trulioo_sdk/models/datasource_result.rb +281 -0
  71. data/lib/trulioo_sdk/models/document.rb +278 -0
  72. data/lib/trulioo_sdk/models/driver_licence.rb +268 -0
  73. data/lib/trulioo_sdk/models/location.rb +347 -0
  74. data/lib/trulioo_sdk/models/location_additional_fields.rb +229 -0
  75. data/lib/trulioo_sdk/models/national_id.rb +277 -0
  76. data/lib/trulioo_sdk/models/normalized_datasource_field.rb +286 -0
  77. data/lib/trulioo_sdk/models/normalized_datasource_group_country.rb +437 -0
  78. data/lib/trulioo_sdk/models/passport.rb +326 -0
  79. data/lib/trulioo_sdk/models/person_info.rb +448 -0
  80. data/lib/trulioo_sdk/models/person_info_additional_fields.rb +228 -0
  81. data/lib/trulioo_sdk/models/record.rb +270 -0
  82. data/lib/trulioo_sdk/models/record_rule.rb +239 -0
  83. data/lib/trulioo_sdk/models/result.rb +440 -0
  84. data/lib/trulioo_sdk/models/service_error.rb +236 -0
  85. data/lib/trulioo_sdk/models/test_entity_data_fields.rb +315 -0
  86. data/lib/trulioo_sdk/models/transaction_record_result.rb +307 -0
  87. data/lib/trulioo_sdk/models/transaction_record_result_all_of.rb +229 -0
  88. data/lib/trulioo_sdk/models/transaction_status.rb +341 -0
  89. data/lib/trulioo_sdk/models/verify_request.rb +410 -0
  90. data/lib/trulioo_sdk/models/verify_result.rb +288 -0
  91. data/lib/trulioo_sdk/version.rb +11 -0
  92. metadata +223 -0
@@ -0,0 +1,245 @@
1
+ =begin
2
+ Trulioo Ruby SDK
3
+
4
+ Gem version: 1.0.3
5
+ Trulioo OpenAPI version: v1
6
+ Generated by OpenAPI Generator version: 5.0.1
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Trulioo
13
+ class DataField
14
+ attr_accessor :field_name
15
+
16
+ attr_accessor :value
17
+
18
+ attr_accessor :field_group
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'field_name' => :'FieldName',
24
+ :'value' => :'Value',
25
+ :'field_group' => :'FieldGroup'
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :'field_name' => :'String',
38
+ :'value' => :'String',
39
+ :'field_group' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::DataField` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::DataField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'field_name')
65
+ self.field_name = attributes[:'field_name']
66
+ end
67
+
68
+ if attributes.key?(:'value')
69
+ self.value = attributes[:'value']
70
+ end
71
+
72
+ if attributes.key?(:'field_group')
73
+ self.field_group = attributes[:'field_group']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ field_name == o.field_name &&
96
+ value == o.value &&
97
+ field_group == o.field_group
98
+ end
99
+
100
+ # @see the `==` method
101
+ # @param [Object] Object to be compared
102
+ def eql?(o)
103
+ self == o
104
+ end
105
+
106
+ # Calculates hash code according to all attributes.
107
+ # @return [Integer] Hash code
108
+ def hash
109
+ [field_name, value, field_group].hash
110
+ end
111
+
112
+ # :nocov:
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+ # :nocov:
120
+
121
+ # :nocov:
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def build_from_hash(attributes)
126
+ return nil unless attributes.is_a?(Hash)
127
+ self.class.openapi_types.each_pair do |key, type|
128
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
129
+ self.send("#{key}=", nil)
130
+ elsif type =~ /\AArray<(.*)>/i
131
+ # check to ensure the input is an array given that the attribute
132
+ # is documented as an array but the input is not
133
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
134
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ end
139
+ end
140
+
141
+ self
142
+ end
143
+ # :nocov:
144
+
145
+ # :nocov:
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = Trulioo.const_get(type)
185
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+ # :nocov:
189
+
190
+ # :nocov:
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+ # :nocov:
197
+
198
+ # :nocov:
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+ # :nocov:
205
+
206
+ # :nocov:
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ if value.nil?
214
+ is_nullable = self.class.openapi_nullable.include?(attr)
215
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
216
+ end
217
+
218
+ hash[param] = _to_hash(value)
219
+ end
220
+ hash
221
+ end
222
+ # :nocov:
223
+
224
+ # :nocov:
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ # :nocov:
243
+ end
244
+
245
+ end
@@ -0,0 +1,306 @@
1
+ =begin
2
+ Trulioo Ruby SDK
3
+
4
+ Gem version: 1.0.3
5
+ Trulioo OpenAPI version: v1
6
+ Generated by OpenAPI Generator version: 5.0.1
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module Trulioo
13
+ # The data field name-value pairs for the data elements on which the verification is to be performed
14
+ class DataFields
15
+ attr_accessor :person_info
16
+
17
+ attr_accessor :location
18
+
19
+ attr_accessor :communication
20
+
21
+ attr_accessor :driver_licence
22
+
23
+ # National Identification Information
24
+ attr_accessor :national_ids
25
+
26
+ attr_accessor :passport
27
+
28
+ attr_accessor :document
29
+
30
+ attr_accessor :business
31
+
32
+ # CountrySpecific fields {\"CountryCode\" : {\"Field1\" : \"Value\", \"Field2\" : \"Value\" }}
33
+ attr_accessor :country_specific
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'person_info' => :'PersonInfo',
39
+ :'location' => :'Location',
40
+ :'communication' => :'Communication',
41
+ :'driver_licence' => :'DriverLicence',
42
+ :'national_ids' => :'NationalIds',
43
+ :'passport' => :'Passport',
44
+ :'document' => :'Document',
45
+ :'business' => :'Business',
46
+ :'country_specific' => :'CountrySpecific'
47
+ }
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'person_info' => :'PersonInfo',
59
+ :'location' => :'Location',
60
+ :'communication' => :'Communication',
61
+ :'driver_licence' => :'DriverLicence',
62
+ :'national_ids' => :'Array<NationalId>',
63
+ :'passport' => :'Passport',
64
+ :'document' => :'Document',
65
+ :'business' => :'Business',
66
+ :'country_specific' => :'Hash<String, Hash<String, String>>'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Trulioo::DataFields` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Trulioo::DataFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'person_info')
92
+ self.person_info = attributes[:'person_info']
93
+ end
94
+
95
+ if attributes.key?(:'location')
96
+ self.location = attributes[:'location']
97
+ end
98
+
99
+ if attributes.key?(:'communication')
100
+ self.communication = attributes[:'communication']
101
+ end
102
+
103
+ if attributes.key?(:'driver_licence')
104
+ self.driver_licence = attributes[:'driver_licence']
105
+ end
106
+
107
+ if attributes.key?(:'national_ids')
108
+ if (value = attributes[:'national_ids']).is_a?(Array)
109
+ self.national_ids = value
110
+ end
111
+ end
112
+
113
+ if attributes.key?(:'passport')
114
+ self.passport = attributes[:'passport']
115
+ end
116
+
117
+ if attributes.key?(:'document')
118
+ self.document = attributes[:'document']
119
+ end
120
+
121
+ if attributes.key?(:'business')
122
+ self.business = attributes[:'business']
123
+ end
124
+
125
+ if attributes.key?(:'country_specific')
126
+ if (value = attributes[:'country_specific']).is_a?(Hash)
127
+ self.country_specific = value
128
+ end
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ invalid_properties = Array.new
136
+ invalid_properties
137
+ end
138
+
139
+ # Check to see if the all the properties in the model are valid
140
+ # @return true if the model is valid
141
+ def valid?
142
+ true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ person_info == o.person_info &&
151
+ location == o.location &&
152
+ communication == o.communication &&
153
+ driver_licence == o.driver_licence &&
154
+ national_ids == o.national_ids &&
155
+ passport == o.passport &&
156
+ document == o.document &&
157
+ business == o.business &&
158
+ country_specific == o.country_specific
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [person_info, location, communication, driver_licence, national_ids, passport, document, business, country_specific].hash
171
+ end
172
+
173
+ # :nocov:
174
+ # Builds the object from hash
175
+ # @param [Hash] attributes Model attributes in the form of hash
176
+ # @return [Object] Returns the model itself
177
+ def self.build_from_hash(attributes)
178
+ new.build_from_hash(attributes)
179
+ end
180
+ # :nocov:
181
+
182
+ # :nocov:
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ self.class.openapi_types.each_pair do |key, type|
189
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
190
+ self.send("#{key}=", nil)
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ end
197
+ elsif !attributes[self.class.attribute_map[key]].nil?
198
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ end
200
+ end
201
+
202
+ self
203
+ end
204
+ # :nocov:
205
+
206
+ # :nocov:
207
+ # Deserializes the data based on type
208
+ # @param string type Data type
209
+ # @param string value Value to be deserialized
210
+ # @return [Object] Deserialized data
211
+ def _deserialize(type, value)
212
+ case type.to_sym
213
+ when :Time
214
+ Time.parse(value)
215
+ when :Date
216
+ Date.parse(value)
217
+ when :String
218
+ value.to_s
219
+ when :Integer
220
+ value.to_i
221
+ when :Float
222
+ value.to_f
223
+ when :Boolean
224
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
225
+ true
226
+ else
227
+ false
228
+ end
229
+ when :Object
230
+ # generic object (usually a Hash), return directly
231
+ value
232
+ when /\AArray<(?<inner_type>.+)>\z/
233
+ inner_type = Regexp.last_match[:inner_type]
234
+ value.map { |v| _deserialize(inner_type, v) }
235
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
236
+ k_type = Regexp.last_match[:k_type]
237
+ v_type = Regexp.last_match[:v_type]
238
+ {}.tap do |hash|
239
+ value.each do |k, v|
240
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
241
+ end
242
+ end
243
+ else # model
244
+ # models (e.g. Pet) or oneOf
245
+ klass = Trulioo.const_get(type)
246
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
247
+ end
248
+ end
249
+ # :nocov:
250
+
251
+ # :nocov:
252
+ # Returns the string representation of the object
253
+ # @return [String] String presentation of the object
254
+ def to_s
255
+ to_hash.to_s
256
+ end
257
+ # :nocov:
258
+
259
+ # :nocov:
260
+ # to_body is an alias to to_hash (backward compatibility)
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_body
263
+ to_hash
264
+ end
265
+ # :nocov:
266
+
267
+ # :nocov:
268
+ # Returns the object in the form of hash
269
+ # @return [Hash] Returns the object in the form of hash
270
+ def to_hash
271
+ hash = {}
272
+ self.class.attribute_map.each_pair do |attr, param|
273
+ value = self.send(attr)
274
+ if value.nil?
275
+ is_nullable = self.class.openapi_nullable.include?(attr)
276
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
277
+ end
278
+
279
+ hash[param] = _to_hash(value)
280
+ end
281
+ hash
282
+ end
283
+ # :nocov:
284
+
285
+ # :nocov:
286
+ # Outputs non-array value in the form of hash
287
+ # For object, use to_hash. Otherwise, just return the value
288
+ # @param [Object] value Any valid value
289
+ # @return [Hash] Returns the value in the form of hash
290
+ def _to_hash(value)
291
+ if value.is_a?(Array)
292
+ value.compact.map { |v| _to_hash(v) }
293
+ elsif value.is_a?(Hash)
294
+ {}.tap do |hash|
295
+ value.each { |k, v| hash[k] = _to_hash(v) }
296
+ end
297
+ elsif value.respond_to? :to_hash
298
+ value.to_hash
299
+ else
300
+ value
301
+ end
302
+ end
303
+ # :nocov:
304
+ end
305
+
306
+ end