polar_accesslink 1.0.2 → 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 (141) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -5
  3. data/README.md +20 -65
  4. data/Rakefile +0 -2
  5. data/docs/DailyActivityApi.md +96 -123
  6. data/docs/ExercisesApi.md +35 -55
  7. data/docs/NightlyRechargeApi.md +96 -0
  8. data/docs/PhysicalInfoApi.md +60 -79
  9. data/docs/PullNotificationsApi.md +11 -20
  10. data/docs/SleepApi.md +137 -0
  11. data/docs/TrainingDataApi.md +175 -213
  12. data/docs/UsersApi.md +33 -56
  13. data/docs/WebhooksApi.md +43 -80
  14. data/git_push.sh +55 -0
  15. data/lib/polar_accesslink.rb +5 -36
  16. data/lib/polar_accesslink/api/daily_activity_api.rb +101 -201
  17. data/lib/polar_accesslink/api/exercises_api.rb +43 -81
  18. data/lib/polar_accesslink/api/nightly_recharge_api.rb +115 -0
  19. data/lib/polar_accesslink/api/physical_info_api.rb +65 -114
  20. data/lib/polar_accesslink/api/pull_notifications_api.rb +15 -27
  21. data/lib/polar_accesslink/api/sleep_api.rb +158 -0
  22. data/lib/polar_accesslink/api/training_data_api.rb +178 -332
  23. data/lib/polar_accesslink/api/users_api.rb +42 -96
  24. data/lib/polar_accesslink/api/webhooks_api.rb +59 -126
  25. data/lib/polar_accesslink/api_client.rb +45 -41
  26. data/lib/polar_accesslink/api_error.rb +3 -22
  27. data/lib/polar_accesslink/configuration.rb +9 -62
  28. data/lib/polar_accesslink/version.rb +3 -3
  29. data/polar_accesslink.gemspec +2 -1
  30. data/spec/api/daily_activity_api_spec.rb +11 -11
  31. data/spec/api/exercises_api_spec.rb +9 -9
  32. data/spec/api/nightly_recharge_api_spec.rb +58 -0
  33. data/spec/api/physical_info_api_spec.rb +9 -9
  34. data/spec/api/pull_notifications_api_spec.rb +7 -7
  35. data/spec/api/sleep_api_spec.rb +69 -0
  36. data/spec/api/training_data_api_spec.rb +16 -15
  37. data/spec/api/users_api_spec.rb +8 -9
  38. data/spec/api/webhooks_api_spec.rb +11 -13
  39. data/spec/api_client_spec.rb +21 -4
  40. data/spec/configuration_spec.rb +6 -6
  41. data/spec/spec_helper.rb +3 -3
  42. metadata +36 -145
  43. data/docs/Activity.md +0 -33
  44. data/docs/ActivityLog.md +0 -17
  45. data/docs/ActivityStepSample.md +0 -19
  46. data/docs/ActivityStepSamples.md +0 -19
  47. data/docs/ActivityZoneSample.md +0 -19
  48. data/docs/ActivityZoneSamples.md +0 -19
  49. data/docs/AvailableUserData.md +0 -21
  50. data/docs/AvailableUserDatas.md +0 -17
  51. data/docs/CreatedWebhook.md +0 -17
  52. data/docs/CreatedWebhookData.md +0 -23
  53. data/docs/DurationZone.md +0 -19
  54. data/docs/Error.md +0 -25
  55. data/docs/Exercise.md +0 -47
  56. data/docs/ExerciseHashId.md +0 -45
  57. data/docs/Exercises.md +0 -17
  58. data/docs/HeartRate.md +0 -19
  59. data/docs/PhysicalInformation.md +0 -39
  60. data/docs/PhysicalInformations.md +0 -17
  61. data/docs/Register.md +0 -17
  62. data/docs/Sample.md +0 -21
  63. data/docs/Samples.md +0 -17
  64. data/docs/TransactionLocation.md +0 -19
  65. data/docs/User.md +0 -35
  66. data/docs/UserExtraInfo.md +0 -21
  67. data/docs/WebhookInfo.md +0 -17
  68. data/docs/WebhookInfoData.md +0 -21
  69. data/docs/WebhookPatch.md +0 -19
  70. data/docs/WebhookPayload.md +0 -25
  71. data/docs/WebhookPing.md +0 -19
  72. data/docs/WebhookRequest.md +0 -19
  73. data/docs/WebhookType.md +0 -16
  74. data/docs/Zone.md +0 -23
  75. data/docs/Zones.md +0 -17
  76. data/lib/polar_accesslink/models/activity.rb +0 -288
  77. data/lib/polar_accesslink/models/activity_log.rb +0 -210
  78. data/lib/polar_accesslink/models/activity_step_sample.rb +0 -218
  79. data/lib/polar_accesslink/models/activity_step_samples.rb +0 -220
  80. data/lib/polar_accesslink/models/activity_zone_sample.rb +0 -220
  81. data/lib/polar_accesslink/models/activity_zone_samples.rb +0 -220
  82. data/lib/polar_accesslink/models/available_user_data.rb +0 -262
  83. data/lib/polar_accesslink/models/available_user_datas.rb +0 -210
  84. data/lib/polar_accesslink/models/created_webhook.rb +0 -206
  85. data/lib/polar_accesslink/models/created_webhook_data.rb +0 -236
  86. data/lib/polar_accesslink/models/duration_zone.rb +0 -218
  87. data/lib/polar_accesslink/models/error.rb +0 -248
  88. data/lib/polar_accesslink/models/exercise.rb +0 -357
  89. data/lib/polar_accesslink/models/exercise_hash_id.rb +0 -347
  90. data/lib/polar_accesslink/models/exercises.rb +0 -210
  91. data/lib/polar_accesslink/models/heart_rate.rb +0 -218
  92. data/lib/polar_accesslink/models/physical_information.rb +0 -352
  93. data/lib/polar_accesslink/models/physical_informations.rb +0 -210
  94. data/lib/polar_accesslink/models/register.rb +0 -213
  95. data/lib/polar_accesslink/models/sample.rb +0 -228
  96. data/lib/polar_accesslink/models/samples.rb +0 -210
  97. data/lib/polar_accesslink/models/transaction_location.rb +0 -218
  98. data/lib/polar_accesslink/models/user.rb +0 -334
  99. data/lib/polar_accesslink/models/user_extra_info.rb +0 -228
  100. data/lib/polar_accesslink/models/webhook_info.rb +0 -206
  101. data/lib/polar_accesslink/models/webhook_info_data.rb +0 -226
  102. data/lib/polar_accesslink/models/webhook_patch.rb +0 -219
  103. data/lib/polar_accesslink/models/webhook_payload.rb +0 -246
  104. data/lib/polar_accesslink/models/webhook_ping.rb +0 -252
  105. data/lib/polar_accesslink/models/webhook_request.rb +0 -229
  106. data/lib/polar_accesslink/models/webhook_type.rb +0 -37
  107. data/lib/polar_accesslink/models/zone.rb +0 -238
  108. data/lib/polar_accesslink/models/zones.rb +0 -210
  109. data/spec/models/activity_log_spec.rb +0 -41
  110. data/spec/models/activity_spec.rb +0 -89
  111. data/spec/models/activity_step_sample_spec.rb +0 -47
  112. data/spec/models/activity_step_samples_spec.rb +0 -47
  113. data/spec/models/activity_zone_sample_spec.rb +0 -47
  114. data/spec/models/activity_zone_samples_spec.rb +0 -47
  115. data/spec/models/available_user_data_spec.rb +0 -57
  116. data/spec/models/available_user_datas_spec.rb +0 -41
  117. data/spec/models/created_webhook_data_spec.rb +0 -59
  118. data/spec/models/created_webhook_spec.rb +0 -41
  119. data/spec/models/duration_zone_spec.rb +0 -47
  120. data/spec/models/error_spec.rb +0 -65
  121. data/spec/models/exercise_hash_id_spec.rb +0 -125
  122. data/spec/models/exercise_spec.rb +0 -131
  123. data/spec/models/exercises_spec.rb +0 -41
  124. data/spec/models/heart_rate_spec.rb +0 -47
  125. data/spec/models/physical_information_spec.rb +0 -111
  126. data/spec/models/physical_informations_spec.rb +0 -41
  127. data/spec/models/register_spec.rb +0 -41
  128. data/spec/models/sample_spec.rb +0 -53
  129. data/spec/models/samples_spec.rb +0 -41
  130. data/spec/models/transaction_location_spec.rb +0 -47
  131. data/spec/models/user_extra_info_spec.rb +0 -53
  132. data/spec/models/user_spec.rb +0 -99
  133. data/spec/models/webhook_info_data_spec.rb +0 -53
  134. data/spec/models/webhook_info_spec.rb +0 -41
  135. data/spec/models/webhook_patch_spec.rb +0 -47
  136. data/spec/models/webhook_payload_spec.rb +0 -65
  137. data/spec/models/webhook_ping_spec.rb +0 -51
  138. data/spec/models/webhook_request_spec.rb +0 -47
  139. data/spec/models/webhook_type_spec.rb +0 -35
  140. data/spec/models/zone_spec.rb +0 -59
  141. data/spec/models/zones_spec.rb +0 -41
@@ -1,252 +0,0 @@
1
- =begin
2
- #Polar Accesslink API
3
-
4
- #Polar Accesslink API documentation
5
-
6
- The version of the OpenAPI document: 3.40.0
7
- Contact: b2bhelpdesk@polar.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PolarAccesslink
16
- # Accesslink sends ping message as HTTP POST to callback URL being registered when creating new or modifying webhook. Ping message is sent to verify webhook URL. Receiving service must response to ping message with 200 OK or the webhook is not created/modified.
17
- class WebhookPing
18
- # Time when webhook ping is sent.
19
- attr_accessor :timestamp
20
-
21
- # Only possible value is PING for ping message.
22
- attr_accessor :event
23
-
24
- class EnumAttributeValidator
25
- attr_reader :datatype
26
- attr_reader :allowable_values
27
-
28
- def initialize(datatype, allowable_values)
29
- @allowable_values = allowable_values.map do |value|
30
- case datatype.to_s
31
- when /Integer/i
32
- value.to_i
33
- when /Float/i
34
- value.to_f
35
- else
36
- value
37
- end
38
- end
39
- end
40
-
41
- def valid?(value)
42
- !value || allowable_values.include?(value)
43
- end
44
- end
45
-
46
- # Attribute mapping from ruby-style variable name to JSON key.
47
- def self.attribute_map
48
- {
49
- :'timestamp' => :'timestamp',
50
- :'event' => :'event'
51
- }
52
- end
53
-
54
- # Attribute type mapping.
55
- def self.openapi_types
56
- {
57
- :'timestamp' => :'DateTime',
58
- :'event' => :'String'
59
- }
60
- end
61
-
62
- # List of attributes with nullable: true
63
- def self.openapi_nullable
64
- Set.new([
65
- ])
66
- end
67
-
68
- # Initializes the object
69
- # @param [Hash] attributes Model attributes in the form of hash
70
- def initialize(attributes = {})
71
- if (!attributes.is_a?(Hash))
72
- fail ArgumentError, "The input argument (attributes) must be a hash in `PolarAccesslink::WebhookPing` initialize method"
73
- end
74
-
75
- # check to see if the attribute exists and convert string to symbol for hash key
76
- attributes = attributes.each_with_object({}) { |(k, v), h|
77
- if (!self.class.attribute_map.key?(k.to_sym))
78
- fail ArgumentError, "`#{k}` is not a valid attribute in `PolarAccesslink::WebhookPing`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
79
- end
80
- h[k.to_sym] = v
81
- }
82
-
83
- if attributes.key?(:'timestamp')
84
- self.timestamp = attributes[:'timestamp']
85
- end
86
-
87
- if attributes.key?(:'event')
88
- self.event = attributes[:'event']
89
- end
90
- end
91
-
92
- # Show invalid properties with the reasons. Usually used together with valid?
93
- # @return Array for valid properties with the reasons
94
- def list_invalid_properties
95
- invalid_properties = Array.new
96
- invalid_properties
97
- end
98
-
99
- # Check to see if the all the properties in the model are valid
100
- # @return true if the model is valid
101
- def valid?
102
- event_validator = EnumAttributeValidator.new('String', ["PING"])
103
- return false unless event_validator.valid?(@event)
104
- true
105
- end
106
-
107
- # Custom attribute writer method checking allowed values (enum).
108
- # @param [Object] event Object to be assigned
109
- def event=(event)
110
- validator = EnumAttributeValidator.new('String', ["PING"])
111
- unless validator.valid?(event)
112
- fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
113
- end
114
- @event = event
115
- end
116
-
117
- # Checks equality by comparing each attribute.
118
- # @param [Object] Object to be compared
119
- def ==(o)
120
- return true if self.equal?(o)
121
- self.class == o.class &&
122
- timestamp == o.timestamp &&
123
- event == o.event
124
- end
125
-
126
- # @see the `==` method
127
- # @param [Object] Object to be compared
128
- def eql?(o)
129
- self == o
130
- end
131
-
132
- # Calculates hash code according to all attributes.
133
- # @return [Integer] Hash code
134
- def hash
135
- [timestamp, event].hash
136
- end
137
-
138
- # Builds the object from hash
139
- # @param [Hash] attributes Model attributes in the form of hash
140
- # @return [Object] Returns the model itself
141
- def self.build_from_hash(attributes)
142
- new.build_from_hash(attributes)
143
- end
144
-
145
- # Builds the object from hash
146
- # @param [Hash] attributes Model attributes in the form of hash
147
- # @return [Object] Returns the model itself
148
- def build_from_hash(attributes)
149
- return nil unless attributes.is_a?(Hash)
150
- self.class.openapi_types.each_pair do |key, type|
151
- if type =~ /\AArray<(.*)>/i
152
- # check to ensure the input is an array given that the attribute
153
- # is documented as an array but the input is not
154
- if attributes[self.class.attribute_map[key]].is_a?(Array)
155
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
- end
157
- elsif !attributes[self.class.attribute_map[key]].nil?
158
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
- end # or else data not found in attributes(hash), not an issue as the data can be optional
160
- end
161
-
162
- self
163
- end
164
-
165
- # Deserializes the data based on type
166
- # @param string type Data type
167
- # @param string value Value to be deserialized
168
- # @return [Object] Deserialized data
169
- def _deserialize(type, value)
170
- case type.to_sym
171
- when :DateTime
172
- DateTime.parse(value)
173
- when :Date
174
- Date.parse(value)
175
- when :String
176
- value.to_s
177
- when :Integer
178
- value.to_i
179
- when :Float
180
- value.to_f
181
- when :Boolean
182
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
- true
184
- else
185
- false
186
- end
187
- when :Object
188
- # generic object (usually a Hash), return directly
189
- value
190
- when /\AArray<(?<inner_type>.+)>\z/
191
- inner_type = Regexp.last_match[:inner_type]
192
- value.map { |v| _deserialize(inner_type, v) }
193
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
- k_type = Regexp.last_match[:k_type]
195
- v_type = Regexp.last_match[:v_type]
196
- {}.tap do |hash|
197
- value.each do |k, v|
198
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
- end
200
- end
201
- else # model
202
- PolarAccesslink.const_get(type).build_from_hash(value)
203
- end
204
- end
205
-
206
- # Returns the string representation of the object
207
- # @return [String] String presentation of the object
208
- def to_s
209
- to_hash.to_s
210
- end
211
-
212
- # to_body is an alias to to_hash (backward compatibility)
213
- # @return [Hash] Returns the object in the form of hash
214
- def to_body
215
- to_hash
216
- end
217
-
218
- # Returns the object in the form of hash
219
- # @return [Hash] Returns the object in the form of hash
220
- def to_hash
221
- hash = {}
222
- self.class.attribute_map.each_pair do |attr, param|
223
- value = self.send(attr)
224
- if value.nil?
225
- is_nullable = self.class.openapi_nullable.include?(attr)
226
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
227
- end
228
-
229
- hash[param] = _to_hash(value)
230
- end
231
- hash
232
- end
233
-
234
- # Outputs non-array value in the form of hash
235
- # For object, use to_hash. Otherwise, just return the value
236
- # @param [Object] value Any valid value
237
- # @return [Hash] Returns the value in the form of hash
238
- def _to_hash(value)
239
- if value.is_a?(Array)
240
- value.compact.map { |v| _to_hash(v) }
241
- elsif value.is_a?(Hash)
242
- {}.tap do |hash|
243
- value.each { |k, v| hash[k] = _to_hash(v) }
244
- end
245
- elsif value.respond_to? :to_hash
246
- value.to_hash
247
- else
248
- value
249
- end
250
- end
251
- end
252
- end
@@ -1,229 +0,0 @@
1
- =begin
2
- #Polar Accesslink API
3
-
4
- #Polar Accesslink API documentation
5
-
6
- The version of the OpenAPI document: 3.40.0
7
- Contact: b2bhelpdesk@polar.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module PolarAccesslink
16
- class WebhookRequest
17
- # Type of events to subscribe.
18
- attr_accessor :events
19
-
20
- # Url where the webhook notification is sent.
21
- attr_accessor :url
22
-
23
- # Attribute mapping from ruby-style variable name to JSON key.
24
- def self.attribute_map
25
- {
26
- :'events' => :'events',
27
- :'url' => :'url'
28
- }
29
- end
30
-
31
- # Attribute type mapping.
32
- def self.openapi_types
33
- {
34
- :'events' => :'Array<WebhookType>',
35
- :'url' => :'String'
36
- }
37
- end
38
-
39
- # List of attributes with nullable: true
40
- def self.openapi_nullable
41
- Set.new([
42
- ])
43
- end
44
-
45
- # Initializes the object
46
- # @param [Hash] attributes Model attributes in the form of hash
47
- def initialize(attributes = {})
48
- if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `PolarAccesslink::WebhookRequest` initialize method"
50
- end
51
-
52
- # check to see if the attribute exists and convert string to symbol for hash key
53
- attributes = attributes.each_with_object({}) { |(k, v), h|
54
- if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `PolarAccesslink::WebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
- end
57
- h[k.to_sym] = v
58
- }
59
-
60
- if attributes.key?(:'events')
61
- if (value = attributes[:'events']).is_a?(Array)
62
- self.events = value
63
- end
64
- end
65
-
66
- if attributes.key?(:'url')
67
- self.url = attributes[:'url']
68
- end
69
- end
70
-
71
- # Show invalid properties with the reasons. Usually used together with valid?
72
- # @return Array for valid properties with the reasons
73
- def list_invalid_properties
74
- invalid_properties = Array.new
75
- if @events.nil?
76
- invalid_properties.push('invalid value for "events", events cannot be nil.')
77
- end
78
-
79
- if @url.nil?
80
- invalid_properties.push('invalid value for "url", url cannot be nil.')
81
- end
82
-
83
- invalid_properties
84
- end
85
-
86
- # Check to see if the all the properties in the model are valid
87
- # @return true if the model is valid
88
- def valid?
89
- return false if @events.nil?
90
- return false if @url.nil?
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
- events == o.events &&
100
- url == o.url
101
- end
102
-
103
- # @see the `==` method
104
- # @param [Object] Object to be compared
105
- def eql?(o)
106
- self == o
107
- end
108
-
109
- # Calculates hash code according to all attributes.
110
- # @return [Integer] Hash code
111
- def hash
112
- [events, url].hash
113
- end
114
-
115
- # Builds the object from hash
116
- # @param [Hash] attributes Model attributes in the form of hash
117
- # @return [Object] Returns the model itself
118
- def self.build_from_hash(attributes)
119
- new.build_from_hash(attributes)
120
- end
121
-
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 type =~ /\AArray<(.*)>/i
129
- # check to ensure the input is an array given that the attribute
130
- # is documented as an array but the input is not
131
- if attributes[self.class.attribute_map[key]].is_a?(Array)
132
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
133
- end
134
- elsif !attributes[self.class.attribute_map[key]].nil?
135
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
136
- end # or else data not found in attributes(hash), not an issue as the data can be optional
137
- end
138
-
139
- self
140
- end
141
-
142
- # Deserializes the data based on type
143
- # @param string type Data type
144
- # @param string value Value to be deserialized
145
- # @return [Object] Deserialized data
146
- def _deserialize(type, value)
147
- case type.to_sym
148
- when :DateTime
149
- DateTime.parse(value)
150
- when :Date
151
- Date.parse(value)
152
- when :String
153
- value.to_s
154
- when :Integer
155
- value.to_i
156
- when :Float
157
- value.to_f
158
- when :Boolean
159
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
- true
161
- else
162
- false
163
- end
164
- when :Object
165
- # generic object (usually a Hash), return directly
166
- value
167
- when /\AArray<(?<inner_type>.+)>\z/
168
- inner_type = Regexp.last_match[:inner_type]
169
- value.map { |v| _deserialize(inner_type, v) }
170
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
- k_type = Regexp.last_match[:k_type]
172
- v_type = Regexp.last_match[:v_type]
173
- {}.tap do |hash|
174
- value.each do |k, v|
175
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
- end
177
- end
178
- else # model
179
- PolarAccesslink.const_get(type).build_from_hash(value)
180
- end
181
- end
182
-
183
- # Returns the string representation of the object
184
- # @return [String] String presentation of the object
185
- def to_s
186
- to_hash.to_s
187
- end
188
-
189
- # to_body is an alias to to_hash (backward compatibility)
190
- # @return [Hash] Returns the object in the form of hash
191
- def to_body
192
- to_hash
193
- end
194
-
195
- # Returns the object in the form of hash
196
- # @return [Hash] Returns the object in the form of hash
197
- def to_hash
198
- hash = {}
199
- self.class.attribute_map.each_pair do |attr, param|
200
- value = self.send(attr)
201
- if value.nil?
202
- is_nullable = self.class.openapi_nullable.include?(attr)
203
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
- end
205
-
206
- hash[param] = _to_hash(value)
207
- end
208
- hash
209
- end
210
-
211
- # Outputs non-array value in the form of hash
212
- # For object, use to_hash. Otherwise, just return the value
213
- # @param [Object] value Any valid value
214
- # @return [Hash] Returns the value in the form of hash
215
- def _to_hash(value)
216
- if value.is_a?(Array)
217
- value.compact.map { |v| _to_hash(v) }
218
- elsif value.is_a?(Hash)
219
- {}.tap do |hash|
220
- value.each { |k, v| hash[k] = _to_hash(v) }
221
- end
222
- elsif value.respond_to? :to_hash
223
- value.to_hash
224
- else
225
- value
226
- end
227
- end
228
- end
229
- end