mockserver-client 1.0.8.pre → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -1
  3. data/Gemfile.lock +79 -0
  4. data/README.md +89 -229
  5. data/Rakefile +8 -8
  6. data/docs/Body.md +7 -0
  7. data/docs/BodyWithContentType.md +7 -0
  8. data/docs/ConnectionOptions.md +12 -0
  9. data/docs/ControlApi.md +269 -0
  10. data/docs/Delay.md +9 -0
  11. data/docs/Expectation.md +7 -0
  12. data/docs/ExpectationApi.md +51 -0
  13. data/docs/Expectations.md +7 -0
  14. data/docs/HttpClassCallback.md +8 -0
  15. data/docs/HttpError.md +10 -0
  16. data/docs/HttpForward.md +11 -0
  17. data/docs/HttpObjectCallback.md +8 -0
  18. data/docs/HttpOverrideForwardedRequest.md +9 -0
  19. data/docs/HttpRequest.md +15 -0
  20. data/docs/HttpResponse.md +14 -0
  21. data/docs/HttpTemplate.md +10 -0
  22. data/docs/KeyToMultiValue.md +7 -0
  23. data/docs/KeyToValue.md +7 -0
  24. data/docs/Ports.md +8 -0
  25. data/docs/TimeToLive.md +10 -0
  26. data/docs/Times.md +9 -0
  27. data/docs/Verification.md +9 -0
  28. data/docs/VerificationSequence.md +8 -0
  29. data/docs/VerificationTimes.md +9 -0
  30. data/docs/VerifyApi.md +94 -0
  31. data/lib/mockserver-client.rb +62 -15
  32. data/lib/mockserver-client/api/control_api.rb +316 -0
  33. data/lib/mockserver-client/api/expectation_api.rb +73 -0
  34. data/lib/mockserver-client/api/verify_api.rb +127 -0
  35. data/lib/mockserver-client/api_client.rb +388 -0
  36. data/lib/mockserver-client/api_error.rb +38 -0
  37. data/lib/mockserver-client/configuration.rb +202 -0
  38. data/lib/mockserver-client/models/body.rb +174 -0
  39. data/lib/mockserver-client/models/body_with_content_type.rb +174 -0
  40. data/lib/mockserver-client/models/connection_options.rb +219 -0
  41. data/lib/mockserver-client/models/delay.rb +192 -0
  42. data/lib/mockserver-client/models/expectation.rb +174 -0
  43. data/lib/mockserver-client/models/expectations.rb +174 -0
  44. data/lib/mockserver-client/models/http_class_callback.rb +183 -0
  45. data/lib/mockserver-client/models/http_error.rb +201 -0
  46. data/lib/mockserver-client/models/http_forward.rb +244 -0
  47. data/lib/mockserver-client/models/http_object_callback.rb +183 -0
  48. data/lib/mockserver-client/models/http_override_forwarded_request.rb +192 -0
  49. data/lib/mockserver-client/models/http_request.rb +246 -0
  50. data/lib/mockserver-client/models/http_response.rb +237 -0
  51. data/lib/mockserver-client/models/http_template.rb +235 -0
  52. data/lib/mockserver-client/models/key_to_multi_value.rb +174 -0
  53. data/lib/mockserver-client/models/key_to_value.rb +174 -0
  54. data/lib/mockserver-client/models/ports.rb +185 -0
  55. data/lib/mockserver-client/models/time_to_live.rb +235 -0
  56. data/lib/mockserver-client/models/times.rb +192 -0
  57. data/lib/mockserver-client/models/verification.rb +192 -0
  58. data/lib/mockserver-client/models/verification_sequence.rb +185 -0
  59. data/lib/mockserver-client/models/verification_times.rb +192 -0
  60. data/lib/mockserver-client/version.rb +15 -0
  61. data/mockserver-client.gemspec +44 -36
  62. data/spec/api/control_api_spec.rb +102 -0
  63. data/spec/api/expectation_api_spec.rb +46 -0
  64. data/spec/api/verify_api_spec.rb +57 -0
  65. data/spec/api_client_spec.rb +226 -0
  66. data/spec/configuration_spec.rb +42 -0
  67. data/spec/models/body_spec.rb +35 -0
  68. data/spec/models/body_with_content_type_spec.rb +35 -0
  69. data/spec/models/connection_options_spec.rb +65 -0
  70. data/spec/models/delay_spec.rb +47 -0
  71. data/spec/models/expectation_spec.rb +35 -0
  72. data/spec/models/expectations_spec.rb +35 -0
  73. data/spec/models/http_class_callback_spec.rb +41 -0
  74. data/spec/models/http_error_spec.rb +53 -0
  75. data/spec/models/http_forward_spec.rb +63 -0
  76. data/spec/models/http_object_callback_spec.rb +41 -0
  77. data/spec/models/http_override_forwarded_request_spec.rb +47 -0
  78. data/spec/models/http_request_spec.rb +83 -0
  79. data/spec/models/http_response_spec.rb +77 -0
  80. data/spec/models/http_template_spec.rb +57 -0
  81. data/spec/models/key_to_multi_value_spec.rb +35 -0
  82. data/spec/models/key_to_value_spec.rb +35 -0
  83. data/spec/models/ports_spec.rb +41 -0
  84. data/spec/models/time_to_live_spec.rb +57 -0
  85. data/spec/models/times_spec.rb +47 -0
  86. data/spec/models/verification_sequence_spec.rb +41 -0
  87. data/spec/models/verification_spec.rb +47 -0
  88. data/spec/models/verification_times_spec.rb +47 -0
  89. data/spec/spec_helper.rb +103 -53
  90. metadata +225 -158
  91. data/.gitignore +0 -21
  92. data/.rubocop.yml +0 -7
  93. data/bin/mockserver +0 -9
  94. data/lib/cli.rb +0 -146
  95. data/lib/mockserver/abstract_client.rb +0 -111
  96. data/lib/mockserver/mock_server_client.rb +0 -46
  97. data/lib/mockserver/model/array_of.rb +0 -85
  98. data/lib/mockserver/model/body.rb +0 -56
  99. data/lib/mockserver/model/cookie.rb +0 -36
  100. data/lib/mockserver/model/delay.rb +0 -34
  101. data/lib/mockserver/model/enum.rb +0 -47
  102. data/lib/mockserver/model/expectation.rb +0 -139
  103. data/lib/mockserver/model/forward.rb +0 -41
  104. data/lib/mockserver/model/header.rb +0 -43
  105. data/lib/mockserver/model/parameter.rb +0 -43
  106. data/lib/mockserver/model/request.rb +0 -81
  107. data/lib/mockserver/model/response.rb +0 -45
  108. data/lib/mockserver/model/times.rb +0 -61
  109. data/lib/mockserver/proxy_client.rb +0 -9
  110. data/lib/mockserver/utility_methods.rb +0 -59
  111. data/lib/mockserver/version.rb +0 -5
  112. data/pom.xml +0 -118
  113. data/spec/fixtures/forward_mockserver.json +0 -7
  114. data/spec/fixtures/incorrect_login_response.json +0 -20
  115. data/spec/fixtures/post_login_request.json +0 -22
  116. data/spec/fixtures/register_expectation.json +0 -50
  117. data/spec/fixtures/retrieved_request.json +0 -22
  118. data/spec/fixtures/search_request.json +0 -6
  119. data/spec/fixtures/times_once.json +0 -6
  120. data/spec/integration/mock_client_integration_spec.rb +0 -82
  121. data/spec/mockserver/builder_spec.rb +0 -90
  122. data/spec/mockserver/mock_client_spec.rb +0 -80
  123. data/spec/mockserver/proxy_client_spec.rb +0 -38
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #Mock Server API
3
+
4
+ #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test.
5
+
6
+ OpenAPI spec version: 5.3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MockServer
16
+ class HttpRequest
17
+ attr_accessor :body
18
+
19
+ attr_accessor :headers
20
+
21
+ attr_accessor :cookies
22
+
23
+ attr_accessor :query_string_parameters
24
+
25
+ attr_accessor :path
26
+
27
+ attr_accessor :method
28
+
29
+ attr_accessor :secure
30
+
31
+ attr_accessor :keep_alive
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'body' => :'body',
37
+ :'headers' => :'headers',
38
+ :'cookies' => :'cookies',
39
+ :'query_string_parameters' => :'queryStringParameters',
40
+ :'path' => :'path',
41
+ :'method' => :'method',
42
+ :'secure' => :'secure',
43
+ :'keep_alive' => :'keepAlive'
44
+ }
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'body' => :'Body',
51
+ :'headers' => :'KeyToMultiValue',
52
+ :'cookies' => :'KeyToValue',
53
+ :'query_string_parameters' => :'KeyToMultiValue',
54
+ :'path' => :'String',
55
+ :'method' => :'String',
56
+ :'secure' => :'BOOLEAN',
57
+ :'keep_alive' => :'BOOLEAN'
58
+ }
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ return unless attributes.is_a?(Hash)
65
+
66
+ # convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
68
+
69
+ if attributes.has_key?(:'body')
70
+ self.body = attributes[:'body']
71
+ end
72
+
73
+ if attributes.has_key?(:'headers')
74
+ self.headers = attributes[:'headers']
75
+ end
76
+
77
+ if attributes.has_key?(:'cookies')
78
+ self.cookies = attributes[:'cookies']
79
+ end
80
+
81
+ if attributes.has_key?(:'queryStringParameters')
82
+ self.query_string_parameters = attributes[:'queryStringParameters']
83
+ end
84
+
85
+ if attributes.has_key?(:'path')
86
+ self.path = attributes[:'path']
87
+ end
88
+
89
+ if attributes.has_key?(:'method')
90
+ self.method = attributes[:'method']
91
+ end
92
+
93
+ if attributes.has_key?(:'secure')
94
+ self.secure = attributes[:'secure']
95
+ end
96
+
97
+ if attributes.has_key?(:'keepAlive')
98
+ self.keep_alive = attributes[:'keepAlive']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ body == o.body &&
121
+ headers == o.headers &&
122
+ cookies == o.cookies &&
123
+ query_string_parameters == o.query_string_parameters &&
124
+ path == o.path &&
125
+ method == o.method &&
126
+ secure == o.secure &&
127
+ keep_alive == o.keep_alive
128
+ end
129
+
130
+ # @see the `==` method
131
+ # @param [Object] Object to be compared
132
+ def eql?(o)
133
+ self == o
134
+ end
135
+
136
+ # Calculates hash code according to all attributes.
137
+ # @return [Fixnum] Hash code
138
+ def hash
139
+ [body, headers, cookies, query_string_parameters, path, method, secure, keep_alive].hash
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ self.class.openapi_types.each_pair do |key, type|
148
+ if type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :DateTime
169
+ DateTime.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :BOOLEAN
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ temp_model = MockServer.const_get(type).new
200
+ temp_model.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ next if value.nil?
223
+ hash[param] = _to_hash(value)
224
+ end
225
+ hash
226
+ end
227
+
228
+ # Outputs non-array value in the form of hash
229
+ # For object, use to_hash. Otherwise, just return the value
230
+ # @param [Object] value Any valid value
231
+ # @return [Hash] Returns the value in the form of hash
232
+ def _to_hash(value)
233
+ if value.is_a?(Array)
234
+ value.compact.map { |v| _to_hash(v) }
235
+ elsif value.is_a?(Hash)
236
+ {}.tap do |hash|
237
+ value.each { |k, v| hash[k] = _to_hash(v) }
238
+ end
239
+ elsif value.respond_to? :to_hash
240
+ value.to_hash
241
+ else
242
+ value
243
+ end
244
+ end
245
+ end
246
+ end
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Mock Server API
3
+
4
+ #MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below). MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding). Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test.
5
+
6
+ OpenAPI spec version: 5.3.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 3.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module MockServer
16
+ class HttpResponse
17
+ attr_accessor :body
18
+
19
+ attr_accessor :delay
20
+
21
+ attr_accessor :cookies
22
+
23
+ attr_accessor :connection_options
24
+
25
+ attr_accessor :headers
26
+
27
+ attr_accessor :status_code
28
+
29
+ attr_accessor :reason_phrase
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'body' => :'body',
35
+ :'delay' => :'delay',
36
+ :'cookies' => :'cookies',
37
+ :'connection_options' => :'connectionOptions',
38
+ :'headers' => :'headers',
39
+ :'status_code' => :'statusCode',
40
+ :'reason_phrase' => :'reasonPhrase'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'body' => :'BodyWithContentType',
48
+ :'delay' => :'Delay',
49
+ :'cookies' => :'KeyToValue',
50
+ :'connection_options' => :'ConnectionOptions',
51
+ :'headers' => :'KeyToMultiValue',
52
+ :'status_code' => :'Integer',
53
+ :'reason_phrase' => :'String'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ if attributes.has_key?(:'body')
66
+ self.body = attributes[:'body']
67
+ end
68
+
69
+ if attributes.has_key?(:'delay')
70
+ self.delay = attributes[:'delay']
71
+ end
72
+
73
+ if attributes.has_key?(:'cookies')
74
+ self.cookies = attributes[:'cookies']
75
+ end
76
+
77
+ if attributes.has_key?(:'connectionOptions')
78
+ self.connection_options = attributes[:'connectionOptions']
79
+ end
80
+
81
+ if attributes.has_key?(:'headers')
82
+ self.headers = attributes[:'headers']
83
+ end
84
+
85
+ if attributes.has_key?(:'statusCode')
86
+ self.status_code = attributes[:'statusCode']
87
+ end
88
+
89
+ if attributes.has_key?(:'reasonPhrase')
90
+ self.reason_phrase = attributes[:'reasonPhrase']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ body == o.body &&
113
+ delay == o.delay &&
114
+ cookies == o.cookies &&
115
+ connection_options == o.connection_options &&
116
+ headers == o.headers &&
117
+ status_code == o.status_code &&
118
+ reason_phrase == o.reason_phrase
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [body, delay, cookies, connection_options, headers, status_code, reason_phrase].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.openapi_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ temp_model = MockServer.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
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
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end