jamm 0.0.1 → 1.0.1

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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -57
  3. data/.rubocop.yml +18 -25
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +99 -0
  6. data/README.md +4 -4
  7. data/Rakefile +2 -0
  8. data/jamm.gemspec +16 -3
  9. data/lib/jamm/api/api/customer_api.rb +265 -0
  10. data/lib/jamm/api/api/healthcheck_api.rb +76 -0
  11. data/lib/jamm/api/api/payment_api.rb +145 -0
  12. data/lib/jamm/api/api_client.rb +385 -0
  13. data/lib/jamm/api/api_error.rb +58 -0
  14. data/lib/jamm/api/configuration.rb +293 -0
  15. data/lib/jamm/api/models/customer_service_update_customer_body.rb +247 -0
  16. data/lib/jamm/api/models/protobuf_any.rb +209 -0
  17. data/lib/jamm/api/models/rpc_status.rb +218 -0
  18. data/lib/jamm/api/models/v1_buyer.rb +274 -0
  19. data/lib/jamm/api/models/v1_charge.rb +233 -0
  20. data/lib/jamm/api/models/v1_contract.rb +225 -0
  21. data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +217 -0
  22. data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +222 -0
  23. data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +212 -0
  24. data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +217 -0
  25. data/lib/jamm/api/models/v1_create_customer_request.rb +207 -0
  26. data/lib/jamm/api/models/v1_create_customer_response.rb +207 -0
  27. data/lib/jamm/api/models/v1_customer.rb +223 -0
  28. data/lib/jamm/api/models/v1_delete_customer_response.rb +207 -0
  29. data/lib/jamm/api/models/v1_get_customer_response.rb +207 -0
  30. data/lib/jamm/api/models/v1_initial_charge.rb +225 -0
  31. data/lib/jamm/api/models/v1_merchant.rb +212 -0
  32. data/lib/jamm/api/models/v1_merchant_customer.rb +213 -0
  33. data/lib/jamm/api/models/v1_payment_link.rb +221 -0
  34. data/lib/jamm/api/models/v1_ping_response.rb +207 -0
  35. data/lib/jamm/api/models/v1_update_customer_response.rb +207 -0
  36. data/lib/jamm/api/models/v1_url.rb +216 -0
  37. data/lib/jamm/api/version.rb +15 -0
  38. data/lib/jamm/api.rb +64 -0
  39. data/lib/jamm/errors.rb +4 -14
  40. data/lib/jamm/oauth.rb +3 -1
  41. data/lib/jamm/version.rb +3 -1
  42. data/lib/jamm.rb +14 -127
  43. metadata +59 -38
  44. data/.github/workflows/build.yml +0 -23
  45. data/.github/workflows/ruby-publish.yml +0 -24
  46. data/CONTRIBUTORS +0 -1
  47. data/images/jamm_logo.png +0 -0
  48. data/lib/jamm/api_operations/create.rb +0 -16
  49. data/lib/jamm/api_operations/get.rb +0 -16
  50. data/lib/jamm/api_operations/list.rb +0 -16
  51. data/lib/jamm/api_operations/update.rb +0 -16
  52. data/lib/jamm/api_resource.rb +0 -5
  53. data/lib/jamm/charge.rb +0 -10
  54. data/lib/jamm/jamm_object.rb +0 -249
  55. data/lib/jamm/payment.rb +0 -18
  56. data/lib/jamm/request.rb +0 -13
  57. data/lib/jamm/time_util.rb +0 -41
  58. data/lib/jamm/token.rb +0 -10
  59. data/lib/jamm/util.rb +0 -76
  60. data/test/jamm/charge_test.rb +0 -56
  61. data/test/jamm/oauth_test.rb +0 -47
  62. data/test/jamm/payment_test.rb +0 -17
  63. data/test/jamm/time_util_test.rb +0 -18
  64. data/test/jamm/token_test.rb +0 -52
  65. data/test/test_data.rb +0 -118
  66. data/test/test_helper.rb +0 -59
@@ -0,0 +1,293 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #api/v1/common.proto
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: version not set
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ module Api
14
+ class Configuration
15
+ # Defines url scheme
16
+ attr_accessor :scheme
17
+
18
+ # Defines url host
19
+ attr_accessor :host
20
+
21
+ # Defines url base path
22
+ attr_accessor :base_path
23
+
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
36
+ # Defines API keys used with API Key authentications.
37
+ #
38
+ # @return [Hash] key: parameter name, value: parameter value (API key)
39
+ #
40
+ # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
41
+ # config.api_key['api_key'] = 'xxx'
42
+ attr_accessor :api_key
43
+
44
+ # Defines API key prefixes used with API Key authentications.
45
+ #
46
+ # @return [Hash] key: parameter name, value: API key prefix
47
+ #
48
+ # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
49
+ # config.api_key_prefix['api_key'] = 'Token'
50
+ attr_accessor :api_key_prefix
51
+
52
+ # Defines the username used with HTTP basic authentication.
53
+ #
54
+ # @return [String]
55
+ attr_accessor :username
56
+
57
+ # Defines the password used with HTTP basic authentication.
58
+ #
59
+ # @return [String]
60
+ attr_accessor :password
61
+
62
+ # Defines the access token (Bearer) used with OAuth2.
63
+ attr_accessor :access_token
64
+
65
+ # Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
66
+ # Overrides the access_token if set
67
+ # @return [Proc]
68
+ attr_accessor :access_token_getter
69
+
70
+ # Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
71
+ # HTTP responses with return type `File` will be returned as a stream of binary data.
72
+ # Default to false.
73
+ attr_accessor :return_binary_data
74
+
75
+ # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
76
+ # details will be logged with `logger.debug` (see the `logger` attribute).
77
+ # Default to false.
78
+ #
79
+ # @return [true, false]
80
+ attr_accessor :debugging
81
+
82
+ # Set this to ignore operation servers for the API client. This is useful when you need to
83
+ # send requests to a different server than the one specified in the OpenAPI document.
84
+ # Will default to the base url defined in the spec but can be overridden by setting
85
+ # `scheme`, `host`, `base_path` directly.
86
+ # Default to false.
87
+ # @return [true, false]
88
+ attr_accessor :ignore_operation_servers
89
+
90
+ # Defines the logger used for debugging.
91
+ # Default to `Rails.logger` (when in Rails) or logging to STDOUT.
92
+ #
93
+ # @return [#debug]
94
+ attr_accessor :logger
95
+
96
+ # Defines the temporary folder to store downloaded files
97
+ # (for API endpoints that have file response).
98
+ # Default to use `Tempfile`.
99
+ #
100
+ # @return [String]
101
+ attr_accessor :temp_folder_path
102
+
103
+ # The time limit for HTTP request in seconds.
104
+ # Default to 0 (never times out).
105
+ attr_accessor :timeout
106
+
107
+ # Set this to false to skip client side validation in the operation.
108
+ # Default to true.
109
+ # @return [true, false]
110
+ attr_accessor :client_side_validation
111
+
112
+ ### TLS/SSL setting
113
+ # Set this to false to skip verifying SSL certificate when calling API from https server.
114
+ # Default to true.
115
+ #
116
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
117
+ #
118
+ # @return [true, false]
119
+ attr_accessor :verify_ssl
120
+
121
+ ### TLS/SSL setting
122
+ # Set this to false to skip verifying SSL host name
123
+ # Default to true.
124
+ #
125
+ # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
126
+ #
127
+ # @return [true, false]
128
+ attr_accessor :verify_ssl_host
129
+
130
+ ### TLS/SSL setting
131
+ # Set this to customize the certificate file to verify the peer.
132
+ #
133
+ # @return [String] the path to the certificate file
134
+ #
135
+ # @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
136
+ # https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
137
+ attr_accessor :ssl_ca_cert
138
+
139
+ ### TLS/SSL setting
140
+ # Client certificate file (for client certificate)
141
+ attr_accessor :cert_file
142
+
143
+ ### TLS/SSL setting
144
+ # Client private key file (for client certificate)
145
+ attr_accessor :key_file
146
+
147
+ # Set this to customize parameters encoding of array parameter with multi collectionFormat.
148
+ # Default to nil.
149
+ #
150
+ # @see The params_encoding option of Ethon. Related source code:
151
+ # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
152
+ attr_accessor :params_encoding
153
+
154
+ attr_accessor :inject_format, :force_ending_format
155
+
156
+ def initialize
157
+ @scheme = 'http'
158
+ @host = 'localhost'
159
+ @base_path = ''
160
+ @server_index = nil
161
+ @server_operation_index = {}
162
+ @server_variables = {}
163
+ @server_operation_variables = {}
164
+ @api_key = {}
165
+ @api_key_prefix = {}
166
+ @client_side_validation = true
167
+ @verify_ssl = true
168
+ @verify_ssl_host = true
169
+ @cert_file = nil
170
+ @key_file = nil
171
+ @timeout = 0
172
+ @params_encoding = nil
173
+ @debugging = false
174
+ @ignore_operation_servers = false
175
+ @inject_format = false
176
+ @force_ending_format = false
177
+ @logger = defined?(Rails) ? Rails.logger : Logger.new($stdout)
178
+
179
+ yield(self) if block_given?
180
+ end
181
+
182
+ # The default Configuration object.
183
+ def self.default
184
+ @@default ||= Configuration.new
185
+ end
186
+
187
+ def configure
188
+ yield(self) if block_given?
189
+ end
190
+
191
+ def scheme=(scheme)
192
+ # remove :// from scheme
193
+ @scheme = scheme.sub(%r{://}, '')
194
+ end
195
+
196
+ def host=(host)
197
+ # remove http(s):// and anything after a slash
198
+ @host = host.sub(%r{https?://}, '').split('/').first
199
+ end
200
+
201
+ def base_path=(base_path)
202
+ # Add leading and trailing slashes to base_path
203
+ @base_path = "/#{base_path}".gsub(%r{/+}, '/')
204
+ @base_path = '' if @base_path == '/'
205
+ end
206
+
207
+ # Returns base URL for specified operation based on server settings
208
+ def base_url(operation = nil)
209
+ return "#{scheme}://#{[host, base_path].join('/').gsub(%r{/+}, '/')}".sub(%r{/+\z}, '') if ignore_operation_servers
210
+
211
+ if operation_server_settings.key?(operation)
212
+ index = server_operation_index.fetch(operation, server_index)
213
+ server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
214
+ else
215
+ server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(%r{/+}, '/')}".sub(%r{/+\z}, '') : server_url(server_index, server_variables, nil)
216
+ end
217
+ end
218
+
219
+ # Gets API key (with prefix if set).
220
+ # @param [String] param_name the parameter name of API key auth
221
+ def api_key_with_prefix(param_name, param_alias = nil)
222
+ key = @api_key[param_name]
223
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
224
+ if @api_key_prefix[param_name]
225
+ "#{@api_key_prefix[param_name]} #{key}"
226
+ else
227
+ key
228
+ end
229
+ end
230
+
231
+ # Gets access_token using access_token_getter or uses the static access_token
232
+ def access_token_with_refresh
233
+ return access_token if access_token_getter.nil?
234
+
235
+ access_token_getter.call
236
+ end
237
+
238
+ # Gets Basic Auth token string
239
+ def basic_auth_token
240
+ "Basic #{["#{username}:#{password}"].pack('m').delete("\r\n")}"
241
+ end
242
+
243
+ # Returns Auth Settings hash for api client.
244
+ def auth_settings
245
+ {}
246
+ end
247
+
248
+ # Returns an array of Server setting
249
+ def server_settings
250
+ [
251
+ {
252
+ url: '',
253
+ description: 'No description provided'
254
+ }
255
+ ]
256
+ end
257
+
258
+ def operation_server_settings
259
+ {}
260
+ end
261
+
262
+ # Returns URL based on server settings
263
+ #
264
+ # @param index array index of the server settings
265
+ # @param variables hash of variable and the corresponding value
266
+ def server_url(index, variables = {}, servers = nil)
267
+ servers = server_settings if servers.nil?
268
+
269
+ # check array index out of bound
270
+ raise ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}" if index.nil? || index.negative? || index >= servers.size
271
+
272
+ server = servers[index]
273
+ url = server[:url]
274
+
275
+ return url unless server.key? :variables
276
+
277
+ # go through variable and assign a value
278
+ server[:variables].each_key do |name|
279
+ if variables.key?(name)
280
+ raise ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." unless !server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name])
281
+
282
+ url.gsub! "{#{name}}", variables[name]
283
+
284
+ else
285
+ # use default value
286
+ url.gsub! "{#{name}}", server[:variables][name][:default_value]
287
+ end
288
+ end
289
+
290
+ url
291
+ end
292
+ end
293
+ end
@@ -0,0 +1,247 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #api/v1/common.proto
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: version not set
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ # UpdateCustomerRequest is the request to update a customer. We strongly recommend to call this endpoint when you need to update the customer's information for better experience on our dashboard and customer support. UpdateCustomerRequest はCustomerを更新するためのリクエストです。 加盟店の管理画面でより良い体験を提供し、カスタマーサポートを向上させるため、ストアの顧客情報が変更されたら 当エンドポイントを呼び出すことを推奨します。
18
+ class CustomerServiceUpdateCustomerBody
19
+ attr_accessor :email, :name, :katakana_last_name, :katakana_first_name, :address, :birth_date, :gender
20
+
21
+ # Arbitrary key-value additional information about the customer. All the existing metadata will be overwritten by the new metadata. Customerに関する任意のキーと値の追加情報。 すべての既存のメタデータは新しいメタデータで上書きされます。
22
+ attr_accessor :metadata
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :email => :email,
28
+ :name => :name,
29
+ :katakana_last_name => :katakanaLastName,
30
+ :katakana_first_name => :katakanaFirstName,
31
+ :address => :address,
32
+ :birth_date => :birthDate,
33
+ :gender => :gender,
34
+ :metadata => :metadata
35
+ }
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :email => :String,
47
+ :name => :String,
48
+ :katakana_last_name => :String,
49
+ :katakana_first_name => :String,
50
+ :address => :String,
51
+ :birth_date => :String,
52
+ :gender => :String,
53
+ :metadata => :'Hash<String, String>'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::CustomerServiceUpdateCustomerBody` initialize method' unless attributes.is_a?(Hash)
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) do |(k, v), h|
69
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::CustomerServiceUpdateCustomerBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)
70
+
71
+ h[k.to_sym] = v
72
+ end
73
+
74
+ self.email = attributes[:email] if attributes.key?(:email)
75
+
76
+ self.name = attributes[:name] if attributes.key?(:name)
77
+
78
+ self.katakana_last_name = attributes[:katakana_last_name] if attributes.key?(:katakana_last_name)
79
+
80
+ self.katakana_first_name = attributes[:katakana_first_name] if attributes.key?(:katakana_first_name)
81
+
82
+ self.address = attributes[:address] if attributes.key?(:address)
83
+
84
+ self.birth_date = attributes[:birth_date] if attributes.key?(:birth_date)
85
+
86
+ self.gender = attributes[:gender] if attributes.key?(:gender)
87
+
88
+ return unless attributes.key?(:metadata)
89
+ return unless (value = attributes[:metadata]).is_a?(Hash)
90
+
91
+ self.metadata = value
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
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ []
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
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(other)
111
+ return true if equal?(other)
112
+
113
+ self.class == other.class &&
114
+ email == other.email &&
115
+ name == other.name &&
116
+ katakana_last_name == other.katakana_last_name &&
117
+ katakana_first_name == other.katakana_first_name &&
118
+ address == other.address &&
119
+ birth_date == other.birth_date &&
120
+ gender == other.gender &&
121
+ metadata == other.metadata
122
+ end
123
+
124
+ # @see the `==` method
125
+ # @param [Object] Object to be compared
126
+ def eql?(other)
127
+ self == other
128
+ end
129
+
130
+ # Calculates hash code according to all attributes.
131
+ # @return [Integer] Hash code
132
+ def hash
133
+ [email, name, katakana_last_name, katakana_first_name, address, birth_date, gender, metadata].hash
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def self.build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash[key.to_s] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) } if attributes[attribute_map[key]].is_a?(Array)
151
+ elsif !attributes[attribute_map[key]].nil?
152
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
153
+ end
154
+ end
155
+ new(transformed_hash)
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def self._deserialize(type, value)
163
+ case type.to_sym
164
+ when :Time
165
+ Time.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ # models (e.g. Pet) or oneOf
196
+ klass = Api.const_get(type)
197
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+ end
247
+ end