aspose_cells_cloud 21.1 → 21.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/aspose_cells_cloud/api/cells_api.rb +102 -28
- data/lib/aspose_cells_cloud/api/lite_cells_api.rb +957 -0
- data/lib/aspose_cells_cloud/api_client.rb +2 -1
- data/lib/aspose_cells_cloud/models/access_token_response.rb +13 -13
- data/lib/aspose_cells_cloud/models/cells_document_property.rb +46 -13
- data/lib/aspose_cells_cloud/models/chart_operate_parameter.rb +7 -7
- data/lib/aspose_cells_cloud/models/conditional_formatting_value.rb +1 -1
- data/lib/aspose_cells_cloud/models/custom_filter.rb +1 -1
- data/lib/aspose_cells_cloud/models/dynamic_filter.rb +2 -2
- data/lib/aspose_cells_cloud/models/file_info.rb +221 -0
- data/lib/aspose_cells_cloud/models/files_result.rb +200 -0
- data/lib/aspose_cells_cloud/models/import_picture_option.rb +285 -0
- data/lib/aspose_cells_cloud/models/pivot_item.rb +1 -1
- data/lib/aspose_cells_cloud/models/worksheet_operate_parameter.rb +234 -0
- data/lib/aspose_cells_cloud/version.rb +1 -1
- data/lib/aspose_cells_cloud.rb +5 -0
- data/spec/api/cells_assembly_spec.rb +44 -0
- data/spec/api/cells_clear_objects_spec.rb +43 -0
- data/spec/api/cells_export_spec.rb +220 -0
- data/spec/api/cells_import_spec.rb +43 -0
- data/spec/api/cells_merge_spec.rb +43 -0
- data/spec/api/cells_metadata_spec.rb +72 -0
- data/spec/api/cells_properties_api_spec.rb +1 -1
- data/spec/api/cells_protect_spec.rb +43 -0
- data/spec/api/cells_search_spec.rb +43 -0
- data/spec/api/cells_split_spec.rb +44 -0
- data/spec/api/cells_unlock_spec.rb +43 -0
- data/spec/api/cells_watermark_spec.rb +42 -0
- data/spec/api/cells_workbook_api_spec.rb +26 -0
- data/spec/spec_helper.rb +5 -1
- metadata +18 -2
@@ -0,0 +1,200 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2021 Aspose.Cells Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'date'
|
24
|
+
|
25
|
+
module AsposeCellsCloud
|
26
|
+
|
27
|
+
class FilesResult
|
28
|
+
attr_accessor :files
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'files' => :'Files'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Attribute type mapping.
|
39
|
+
def self.swagger_types
|
40
|
+
{
|
41
|
+
:'files' => :'Array<FileInfo>'
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
return unless attributes.is_a?(Hash)
|
49
|
+
|
50
|
+
# convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
52
|
+
|
53
|
+
if attributes.has_key?(:'Files')
|
54
|
+
if (value = attributes[:'Files']).is_a?(Array)
|
55
|
+
self.files = value
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properies with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
return invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
files == o.files
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Fixnum] Hash code
|
90
|
+
def hash
|
91
|
+
[files].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def build_from_hash(attributes)
|
98
|
+
return nil unless attributes.is_a?(Hash)
|
99
|
+
self.class.swagger_types.each_pair do |key, type|
|
100
|
+
if type =~ /\AArray<(.*)>/i
|
101
|
+
# check to ensure the input is an array given that the the attribute
|
102
|
+
# is documented as an array but the input is not
|
103
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
104
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
105
|
+
end
|
106
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
107
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
108
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
109
|
+
end
|
110
|
+
|
111
|
+
self
|
112
|
+
end
|
113
|
+
|
114
|
+
# Deserializes the data based on type
|
115
|
+
# @param string type Data type
|
116
|
+
# @param string value Value to be deserialized
|
117
|
+
# @return [Object] Deserialized data
|
118
|
+
def _deserialize(type, value)
|
119
|
+
case type.to_sym
|
120
|
+
when :DateTime
|
121
|
+
DateTime.parse(value)
|
122
|
+
when :Date
|
123
|
+
Date.parse(value)
|
124
|
+
when :String
|
125
|
+
value.to_s
|
126
|
+
when :Integer
|
127
|
+
value.to_i
|
128
|
+
when :Float
|
129
|
+
value.to_f
|
130
|
+
when :BOOLEAN
|
131
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
132
|
+
true
|
133
|
+
else
|
134
|
+
false
|
135
|
+
end
|
136
|
+
when :Object
|
137
|
+
# generic object (usually a Hash), return directly
|
138
|
+
value
|
139
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
140
|
+
inner_type = Regexp.last_match[:inner_type]
|
141
|
+
value.map { |v| _deserialize(inner_type, v) }
|
142
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
143
|
+
k_type = Regexp.last_match[:k_type]
|
144
|
+
v_type = Regexp.last_match[:v_type]
|
145
|
+
{}.tap do |hash|
|
146
|
+
value.each do |k, v|
|
147
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
else # model
|
151
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
152
|
+
temp_model.build_from_hash(value)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
# Returns the string representation of the object
|
157
|
+
# @return [String] String presentation of the object
|
158
|
+
def to_s
|
159
|
+
to_hash.to_s
|
160
|
+
end
|
161
|
+
|
162
|
+
# to_body is an alias to to_hash (backward compatibility)
|
163
|
+
# @return [Hash] Returns the object in the form of hash
|
164
|
+
def to_body
|
165
|
+
to_hash
|
166
|
+
end
|
167
|
+
|
168
|
+
# Returns the object in the form of hash
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_hash
|
171
|
+
hash = {}
|
172
|
+
self.class.attribute_map.each_pair do |attr, param|
|
173
|
+
value = self.send(attr)
|
174
|
+
next if value.nil?
|
175
|
+
hash[param] = _to_hash(value)
|
176
|
+
end
|
177
|
+
hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Outputs non-array value in the form of hash
|
181
|
+
# For object, use to_hash. Otherwise, just return the value
|
182
|
+
# @param [Object] value Any valid value
|
183
|
+
# @return [Hash] Returns the value in the form of hash
|
184
|
+
def _to_hash(value)
|
185
|
+
if value.is_a?(Array)
|
186
|
+
value.compact.map{ |v| _to_hash(v) }
|
187
|
+
elsif value.is_a?(Hash)
|
188
|
+
{}.tap do |hash|
|
189
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
190
|
+
end
|
191
|
+
elsif value.respond_to? :to_hash
|
192
|
+
value.to_hash
|
193
|
+
else
|
194
|
+
value
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
@@ -0,0 +1,285 @@
|
|
1
|
+
=begin
|
2
|
+
--------------------------------------------------------------------------------------------------------------------
|
3
|
+
Copyright (c) 2021 Aspose.Cells Cloud
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
SOFTWARE.
|
19
|
+
--------------------------------------------------------------------------------------------------------------------
|
20
|
+
|
21
|
+
=end
|
22
|
+
|
23
|
+
require 'date'
|
24
|
+
|
25
|
+
module AsposeCellsCloud
|
26
|
+
|
27
|
+
class ImportPictureOption
|
28
|
+
attr_accessor :source
|
29
|
+
|
30
|
+
attr_accessor :import_data_type
|
31
|
+
|
32
|
+
attr_accessor :destination_worksheet
|
33
|
+
|
34
|
+
attr_accessor :is_insert
|
35
|
+
|
36
|
+
# Upper Left Row.
|
37
|
+
attr_accessor :upper_left_row
|
38
|
+
|
39
|
+
# Upper Left Column.
|
40
|
+
attr_accessor :upper_left_column
|
41
|
+
|
42
|
+
# Lower Right Row.
|
43
|
+
attr_accessor :lower_right_row
|
44
|
+
|
45
|
+
# Lower Right Column.
|
46
|
+
attr_accessor :lower_right_column
|
47
|
+
|
48
|
+
# Filename.
|
49
|
+
attr_accessor :filename
|
50
|
+
|
51
|
+
# data : base64 string.
|
52
|
+
attr_accessor :data
|
53
|
+
|
54
|
+
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
56
|
+
def self.attribute_map
|
57
|
+
{
|
58
|
+
:'source' => :'Source',
|
59
|
+
:'import_data_type' => :'ImportDataType',
|
60
|
+
:'destination_worksheet' => :'DestinationWorksheet',
|
61
|
+
:'is_insert' => :'IsInsert',
|
62
|
+
:'upper_left_row' => :'UpperLeftRow',
|
63
|
+
:'upper_left_column' => :'UpperLeftColumn',
|
64
|
+
:'lower_right_row' => :'LowerRightRow',
|
65
|
+
:'lower_right_column' => :'LowerRightColumn',
|
66
|
+
:'filename' => :'Filename',
|
67
|
+
:'data' => :'Data'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute type mapping.
|
72
|
+
def self.swagger_types
|
73
|
+
{
|
74
|
+
:'source' => :'FileSource',
|
75
|
+
:'import_data_type' => :'String',
|
76
|
+
:'destination_worksheet' => :'String',
|
77
|
+
:'is_insert' => :'BOOLEAN',
|
78
|
+
:'upper_left_row' => :'Integer',
|
79
|
+
:'upper_left_column' => :'Integer',
|
80
|
+
:'lower_right_row' => :'Integer',
|
81
|
+
:'lower_right_column' => :'Integer',
|
82
|
+
:'filename' => :'String',
|
83
|
+
:'data' => :'String'
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
# Initializes the object
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
def initialize(attributes = {})
|
90
|
+
return unless attributes.is_a?(Hash)
|
91
|
+
|
92
|
+
# convert string to symbol for hash key
|
93
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
94
|
+
|
95
|
+
if attributes.has_key?(:'Source')
|
96
|
+
self.source = attributes[:'Source']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'ImportDataType')
|
100
|
+
self.import_data_type = attributes[:'ImportDataType']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'DestinationWorksheet')
|
104
|
+
self.destination_worksheet = attributes[:'DestinationWorksheet']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'IsInsert')
|
108
|
+
self.is_insert = attributes[:'IsInsert']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'UpperLeftRow')
|
112
|
+
self.upper_left_row = attributes[:'UpperLeftRow']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'UpperLeftColumn')
|
116
|
+
self.upper_left_column = attributes[:'UpperLeftColumn']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.has_key?(:'LowerRightRow')
|
120
|
+
self.lower_right_row = attributes[:'LowerRightRow']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.has_key?(:'LowerRightColumn')
|
124
|
+
self.lower_right_column = attributes[:'LowerRightColumn']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'Filename')
|
128
|
+
self.filename = attributes[:'Filename']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.has_key?(:'Data')
|
132
|
+
self.data = attributes[:'Data']
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
138
|
+
# @return Array for valid properies with the reasons
|
139
|
+
def list_invalid_properties
|
140
|
+
invalid_properties = Array.new
|
141
|
+
return invalid_properties
|
142
|
+
end
|
143
|
+
|
144
|
+
# Check to see if the all the properties in the model are valid
|
145
|
+
# @return true if the model is valid
|
146
|
+
def valid?
|
147
|
+
return true
|
148
|
+
end
|
149
|
+
|
150
|
+
# Checks equality by comparing each attribute.
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def ==(o)
|
153
|
+
return true if self.equal?(o)
|
154
|
+
self.class == o.class &&
|
155
|
+
source == o.source &&
|
156
|
+
import_data_type == o.import_data_type &&
|
157
|
+
destination_worksheet == o.destination_worksheet &&
|
158
|
+
is_insert == o.is_insert &&
|
159
|
+
upper_left_row == o.upper_left_row &&
|
160
|
+
upper_left_column == o.upper_left_column &&
|
161
|
+
lower_right_row == o.lower_right_row &&
|
162
|
+
lower_right_column == o.lower_right_column &&
|
163
|
+
filename == o.filename &&
|
164
|
+
data == o.data
|
165
|
+
end
|
166
|
+
|
167
|
+
# @see the `==` method
|
168
|
+
# @param [Object] Object to be compared
|
169
|
+
def eql?(o)
|
170
|
+
self == o
|
171
|
+
end
|
172
|
+
|
173
|
+
# Calculates hash code according to all attributes.
|
174
|
+
# @return [Fixnum] Hash code
|
175
|
+
def hash
|
176
|
+
[source, import_data_type, destination_worksheet, is_insert, upper_left_row, upper_left_column, lower_right_row, lower_right_column, filename, data].hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Builds the object from hash
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
181
|
+
# @return [Object] Returns the model itself
|
182
|
+
def build_from_hash(attributes)
|
183
|
+
return nil unless attributes.is_a?(Hash)
|
184
|
+
self.class.swagger_types.each_pair do |key, type|
|
185
|
+
if type =~ /\AArray<(.*)>/i
|
186
|
+
# check to ensure the input is an array given that the the attribute
|
187
|
+
# is documented as an array but the input is not
|
188
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
189
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
190
|
+
end
|
191
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
192
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
193
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
194
|
+
end
|
195
|
+
|
196
|
+
self
|
197
|
+
end
|
198
|
+
|
199
|
+
# Deserializes the data based on type
|
200
|
+
# @param string type Data type
|
201
|
+
# @param string value Value to be deserialized
|
202
|
+
# @return [Object] Deserialized data
|
203
|
+
def _deserialize(type, value)
|
204
|
+
case type.to_sym
|
205
|
+
when :DateTime
|
206
|
+
DateTime.parse(value)
|
207
|
+
when :Date
|
208
|
+
Date.parse(value)
|
209
|
+
when :String
|
210
|
+
value.to_s
|
211
|
+
when :Integer
|
212
|
+
value.to_i
|
213
|
+
when :Float
|
214
|
+
value.to_f
|
215
|
+
when :BOOLEAN
|
216
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
217
|
+
true
|
218
|
+
else
|
219
|
+
false
|
220
|
+
end
|
221
|
+
when :Object
|
222
|
+
# generic object (usually a Hash), return directly
|
223
|
+
value
|
224
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
225
|
+
inner_type = Regexp.last_match[:inner_type]
|
226
|
+
value.map { |v| _deserialize(inner_type, v) }
|
227
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
228
|
+
k_type = Regexp.last_match[:k_type]
|
229
|
+
v_type = Regexp.last_match[:v_type]
|
230
|
+
{}.tap do |hash|
|
231
|
+
value.each do |k, v|
|
232
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
233
|
+
end
|
234
|
+
end
|
235
|
+
else # model
|
236
|
+
temp_model = AsposeCellsCloud.const_get(type).new
|
237
|
+
temp_model.build_from_hash(value)
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
# Returns the string representation of the object
|
242
|
+
# @return [String] String presentation of the object
|
243
|
+
def to_s
|
244
|
+
to_hash.to_s
|
245
|
+
end
|
246
|
+
|
247
|
+
# to_body is an alias to to_hash (backward compatibility)
|
248
|
+
# @return [Hash] Returns the object in the form of hash
|
249
|
+
def to_body
|
250
|
+
to_hash
|
251
|
+
end
|
252
|
+
|
253
|
+
# Returns the object in the form of hash
|
254
|
+
# @return [Hash] Returns the object in the form of hash
|
255
|
+
def to_hash
|
256
|
+
hash = {}
|
257
|
+
self.class.attribute_map.each_pair do |attr, param|
|
258
|
+
value = self.send(attr)
|
259
|
+
next if value.nil?
|
260
|
+
hash[param] = _to_hash(value)
|
261
|
+
end
|
262
|
+
hash
|
263
|
+
end
|
264
|
+
|
265
|
+
# Outputs non-array value in the form of hash
|
266
|
+
# For object, use to_hash. Otherwise, just return the value
|
267
|
+
# @param [Object] value Any valid value
|
268
|
+
# @return [Hash] Returns the value in the form of hash
|
269
|
+
def _to_hash(value)
|
270
|
+
if value.is_a?(Array)
|
271
|
+
value.compact.map{ |v| _to_hash(v) }
|
272
|
+
elsif value.is_a?(Hash)
|
273
|
+
{}.tap do |hash|
|
274
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
275
|
+
end
|
276
|
+
elsif value.respond_to? :to_hash
|
277
|
+
value.to_hash
|
278
|
+
else
|
279
|
+
value
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
end
|
284
|
+
|
285
|
+
end
|