aspose_cells_cloud 25.3 → 25.4

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -60
  3. data/lib/aspose_cells_cloud/api/cells_api.rb +15 -0
  4. data/lib/aspose_cells_cloud/models/check_external_reference_options.rb +258 -0
  5. data/lib/aspose_cells_cloud/models/check_formula_error_options.rb +258 -0
  6. data/lib/aspose_cells_cloud/models/checked_external_reference_response.rb +258 -0
  7. data/lib/aspose_cells_cloud/models/checked_formula_errors_response.rb +246 -0
  8. data/lib/aspose_cells_cloud/requests/check_workbook_formula_errors_request.rb +103 -0
  9. data/lib/aspose_cells_cloud/requests/check_wrokbook_external_reference_request.rb +103 -0
  10. data/lib/aspose_cells_cloud/requests/get_workbook_request.rb +9 -2
  11. data/lib/aspose_cells_cloud/requests/post_convert_workbook_request.rb +10 -2
  12. data/lib/aspose_cells_cloud/requests/post_convert_workbook_to_docx_request.rb +9 -2
  13. data/lib/aspose_cells_cloud/requests/post_convert_workbook_to_html_request.rb +9 -2
  14. data/lib/aspose_cells_cloud/requests/post_convert_workbook_to_json_request.rb +9 -2
  15. data/lib/aspose_cells_cloud/requests/post_convert_workbook_to_markdown_request.rb +9 -2
  16. data/lib/aspose_cells_cloud/requests/post_convert_workbook_to_pdf_request.rb +9 -2
  17. data/lib/aspose_cells_cloud/requests/post_convert_workbook_to_pptx_request.rb +9 -2
  18. data/lib/aspose_cells_cloud/requests/post_convert_worksheet_to_image_request.rb +10 -2
  19. data/lib/aspose_cells_cloud/requests/post_export_request.rb +9 -2
  20. data/lib/aspose_cells_cloud/requests/post_import_data_request.rb +9 -2
  21. data/lib/aspose_cells_cloud/requests/post_workbook_save_as_request.rb +9 -2
  22. data/lib/aspose_cells_cloud/requests/put_convert_workbook_request.rb +13 -2
  23. data/lib/aspose_cells_cloud/version.rb +1 -1
  24. data/lib/aspose_cells_cloud.rb +6 -0
  25. data/spec/api/batch_controller_spec.rb +23 -0
  26. data/spec/api/pivot_tables_controller_spec.rb +1 -4
  27. data/spec/conversion/conversion_json_spec.rb +0 -1
  28. data/spec/conversion/conversion_png_spec.rb +0 -1
  29. data/spec/conversion/conversion_spec.rb +18 -23
  30. data/spec/document/light_cells_spec.rb +54 -330
  31. data/spec/spec_helper.rb +3 -3
  32. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21bf7cbccb7ccfc0ff5a7e46fae0b3e1c414c873c12e194927a8a98fe3d7aeab
4
- data.tar.gz: 364938295f42a277ee5755dc742af6a5bde976fc3fb3f602220c7d1f62637c8c
3
+ metadata.gz: e4417876ecd3ec11ccb61c8949bd7b7fadc204a90941fa21079dd3f375f068fc
4
+ data.tar.gz: 658f18a0b9f13d6c5fc7f689e02067c1f5d8324ea25daa21d36ab683332222a0
5
5
  SHA512:
6
- metadata.gz: 9d92eb299cd8cc2c8f1a171628c22642fb254f7986725ca07205b89beb6da07353360cf7118b855d9cca84e41f2a52b051dac338e02dfd1b6548c2ebfd785d7e
7
- data.tar.gz: fd7ac8da0a0c588eb00ffc1a285d50837fc4a29530cd0c2b0283a19deacb5d2fb8bd05effab0264cac0fdb765a5bd8c3b87ba86a666dc0fc85f35f8e2c43d2ee
6
+ metadata.gz: 76ef1857ae3f6cb9085dc7ea009aad3548f3807ce7669f26ded6f109b358ad18486bac8bf82c7b35fd2523b64d39330a347edf1793528f654d9213b1d90d4ce3
7
+ data.tar.gz: 2cee089e939df04b9e1a6a079f6ec1f9f61c44c135b6cae104142360a7523c3ce0a91bc1094734781cae1318855c578e03b9eea6b9bc4ec504fcea8a4490d72d
data/README.md CHANGED
@@ -1,11 +1,68 @@
1
- ![](https://img.shields.io/badge/REST%20API-v3.0-lightgrey) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/25.3)
1
+ ![](https://img.shields.io/badge/aspose.cells%20Cloud%20SDK%20for%20Ruby-25.4-green?style=for-the-badge&logo=ruby) [![Product Page](https://img.shields.io/badge/Product-0288d1?style=for-the-badge&logo=Google-Chrome&logoColor=white)](https://products.aspose.cloud/cells/ruby/) [![Documentation](https://img.shields.io/badge/Documentation-388e3c?style=for-the-badge&logo=Hugo&logoColor=white)](https://docs.aspose.cloud/cells/) [![API Ref](https://img.shields.io/badge/Reference-f39c12?style=for-the-badge&logo=html5&logoColor=white)](https://reference.aspose.cloud/cells/) [![Examples](https://img.shields.io/badge/Examples-1565c0?style=for-the-badge&logo=Github&logoColor=white)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-perl/tree/master/Examples) [![Blog](https://img.shields.io/badge/Blog-d32f2f?style=for-the-badge&logo=WordPress&logoColor=white)](https://blog.aspose.cloud/categories/aspose.cells-cloud-product-family/) [![Support](https://img.shields.io/badge/Support-7b1fa2?style=for-the-badge&logo=Discourse&logoColor=white)](https://forum.aspose.cloud/c/cells/7) ![Gem](https://img.shields.io/gem/v/aspose_cells_cloud?style=for-the-badge) ![Gem](https://img.shields.io/gem/dt/aspose_cells_cloud?style=for-the-badge) [![GitHub license](https://img.shields.io/github/license/aspose-cells-cloud/aspose-cells-cloud-ruby?style=for-the-badge)](https://github.com/aspose-cells-cloud/aspose-cells-cloud-ruby/blob/master/LICENSE) ![GitHub commits since latest release (by date)](https://img.shields.io/github/commits-since/aspose-cells-cloud/aspose-cells-cloud-ruby/25.4?style=for-the-badge)
2
2
 
3
- Aspose.Cells Cloud for Ruby enables you to handle various aspects of Excel files, including cell data, styles, formulas, charts, pivot tables, data validation, comments, drawing objects, images, hyperlinks, and so on. Additionally, it supports operations such as splitting, merging, repairing, and converting to other compatible file formats.
3
+ Aspose.Cells Cloud SDK for Ruby empowers developers to programmatically manage Excel files with precision. This comprehensive Go library supports advanced Excel operations like cell data formatting, dynamic formulas, pivot tables, conditional styling, charts, hyperlinks, comments, and data validation. It also enables seamless Excel file conversion (XLSX, CSV, PDF, ODS), document splitting/merging, and file repair. Designed for cloud integration, this API-first solution accelerates spreadsheet automation while ensuring data integrity across platforms like AWS, Azure, and Google Cloud.
4
4
 
5
5
  # Ruby package for Aspose.Cells Cloud
6
6
 
7
7
  Enhance your Ruby applications with the [Aspose.Cells Cloud](https://products.aspose.cloud/cells/ruby) , enabling seamless integration with [Excel, ODS, CSV, Json and other spreadsheet document formats](https://docs.aspose.cloud/cells/supported-file-formats/). With its powerful APIs, developers can effortlessly read, convert, create, edit, and manipulate the contents of Excel documents without the need for any office software installed on the machine.
8
8
 
9
+ ## Quick Start Guide
10
+
11
+ To begin with Aspose.Cells Cloud, here's what you need to do:
12
+
13
+ 1. Sign up for an account at [Aspose for Cloud](https://dashboard.aspose.cloud/#/apps) to obtain your application details.
14
+ 2. Install the Aspose.Cells Cloud Ruby Package from [RubyGems](https://rubygems.org/).
15
+
16
+ - execute the following command to get the latest Gem package.
17
+
18
+ ```console
19
+ gem 'aspose_cells_cloud', '~> 20.10'
20
+ ```
21
+
22
+ or install directly
23
+
24
+ ```console
25
+ gem install aspose_cells_cloud
26
+ ```
27
+
28
+ 3. Use the conversion code provided below as a reference to add or modify your application.
29
+
30
+ ```ruby
31
+ require 'openssl'
32
+ require 'bundler'
33
+ require 'aspose_cells_cloud'
34
+
35
+ @instance = AsposeCellsCloud::CellsApi.new(ENV['CellsCloudClientId'], ENV['CellsCloudClientSecret'],'v3.0',ENV['CellsCloudApiBaseUrl'])
36
+
37
+ remote_folder = 'TestData/In'
38
+
39
+ local_name = 'Book1.xlsx'
40
+ remote_name = 'Book1.xlsx'
41
+
42
+ format = "csv"
43
+
44
+
45
+ mapFiles = { }
46
+ mapFiles = { }
47
+ mapFiles[local_name] = ::File.open(File.expand_path("TestData/"+local_name),"r")
48
+
49
+ uploadrequest = AsposeCellsCloud::UploadFileRequest.new( { :UploadFiles=>mapFiles,:path=>remote_folder })
50
+ @instance.upload_file(uploadrequest)
51
+ mapFiles[local_name]= ::File.open(File.expand_path("TestData/"+local_name),"r")
52
+ request = AsposeCellsCloud::PutConvertWorkbookRequest.new(:File=>mapFiles,:format=>format);
53
+ @instance.put_convert_workbook(request);
54
+
55
+ ```
56
+
57
+ ## Feature & Enhancements in Version 25.4
58
+
59
+ Full list of issues covering all changes in this release:
60
+
61
+ |**Summary**|**Category**|
62
+ | :- | :- |
63
+ | New API for Comprehensive Formula Error Checks in Excel Workbooks | New Feature |
64
+ | New API for External Reference Checks in Excel Workbooks | New Feature |
65
+
9
66
  ## Manipulate Excel and other spreadsheet files in the Cloud
10
67
 
11
68
  - File Manipulation: Users can upload, download, delete, and manage Excel files stored in the cloud.
@@ -19,16 +76,6 @@ Enhance your Ruby applications with the [Aspose.Cells Cloud](https://products.as
19
76
  - Import/Export: Facilitates importing data from various sources into spreadsheets and exporting spreadsheet data to other formats.
20
77
  - Security Management: Offers a range of security features like data encryption, access control, and permission management to safeguard the security and integrity of spreadsheet data.
21
78
 
22
- ## Feature & Enhancements in Version 25.3
23
-
24
- Full list of issues covering all changes in this release:
25
-
26
- - Optimized the properties of `SaveOptions` to enhance performance and flexibility.
27
- - Optimized the conversion method of `Workbook` for improved efficiency and reliability.
28
- - Developed a new API to retrieve a comprehensive list of all styles in a workbook.
29
- - Enhanced all save options to improve functionality and user experience.
30
- - Added a new API to insert images into cells, providing enhanced document customization capabilities.
31
-
32
79
  ## Support file format
33
80
 
34
81
  |**Format**|**Description**|**Load**|**Save**|
@@ -67,54 +114,6 @@ Full list of issues covering all changes in this release:
67
114
  |[DOCX](https://docs.fileformat.com/word-processing/docx/)|A well-known format for Microsoft Word documents that is a combination of XML and binary files.||√|
68
115
  |[PPTX](https://docs.fileformat.com/presentation/pptx/)|The PPTX format is based on the Microsoft PowerPoint open XML presentation file format.||√|
69
116
 
70
- ## Quick Start Guide
71
-
72
- To begin with Aspose.Cells Cloud, here's what you need to do:
73
-
74
- 1. Sign up for an account at [Aspose for Cloud](https://dashboard.aspose.cloud/#/apps) to obtain your application details.
75
- 2. Install the Aspose.Cells Cloud Ruby Package from [RubyGems](https://rubygems.org/).
76
-
77
- - execute the following command to get the latest Gem package.
78
-
79
- ```console
80
- gem 'aspose_cells_cloud', '~> 20.10'
81
- ```
82
-
83
- or install directly
84
-
85
- ```console
86
- gem install aspose_cells_cloud
87
- ```
88
-
89
- 3. Use the conversion code provided below as a reference to add or modify your application.
90
-
91
- ```ruby
92
- require 'openssl'
93
- require 'bundler'
94
- require 'aspose_cells_cloud'
95
-
96
- @instance = AsposeCellsCloud::CellsApi.new(ENV['CellsCloudClientId'], ENV['CellsCloudClientSecret'],'v3.0',ENV['CellsCloudApiBaseUrl'])
97
-
98
- remote_folder = 'TestData/In'
99
-
100
- local_name = 'Book1.xlsx'
101
- remote_name = 'Book1.xlsx'
102
-
103
- format = "csv"
104
-
105
-
106
- mapFiles = { }
107
- mapFiles = { }
108
- mapFiles[local_name] = ::File.open(File.expand_path("TestData/"+local_name),"r")
109
-
110
- uploadrequest = AsposeCellsCloud::UploadFileRequest.new( { :UploadFiles=>mapFiles,:path=>remote_folder })
111
- @instance.upload_file(uploadrequest)
112
- mapFiles[local_name]= ::File.open(File.expand_path("TestData/"+local_name),"r")
113
- request = AsposeCellsCloud::PutConvertWorkbookRequest.new(:File=>mapFiles,:format=>format);
114
- @instance.put_convert_workbook(request);
115
-
116
- ```
117
-
118
117
  ## Aspose.Cells Cloud in Popular Languages
119
118
 
120
119
  | .NET | Java | PHP | Python | Node.js | Android | Swift | Perl | GO |
@@ -952,6 +952,21 @@ module AsposeCellsCloud
952
952
 
953
953
  # Export Excel internal elements or the workbook itself to various format files.
954
954
 
955
+ def check_wrokbook_external_reference( check_wrokbook_external_reference_request, opts = {})
956
+
957
+ data, _status_code, _headers = check_wrokbook_external_reference_request.create_http_request(@api_client,opts )
958
+ return data
959
+ end
960
+
961
+
962
+ def check_workbook_formula_errors( check_workbook_formula_errors_request, opts = {})
963
+
964
+ data, _status_code, _headers = check_workbook_formula_errors_request.create_http_request(@api_client,opts )
965
+ return data
966
+ end
967
+
968
+ # Export Excel internal elements or the workbook itself to various format files.
969
+
955
970
  def post_export( post_export_request, opts = {})
956
971
 
957
972
  data, _status_code, _headers = post_export_request.create_http_request(@api_client,opts )
@@ -0,0 +1,258 @@
1
+ =begin
2
+ --------------------------------------------------------------------------------------------------------------------
3
+ <copyright company="Aspose" file="CheckExternalReferenceOptionsrb.cs">
4
+ Copyright (c) 2025 Aspose.Cells Cloud
5
+ </copyright>
6
+ <summary>
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
24
+ </summary>
25
+ --------------------------------------------------------------------------------------------------------------------
26
+ =end
27
+
28
+
29
+ require 'date'
30
+
31
+ module AsposeCellsCloud
32
+
33
+ class CheckExternalReferenceOptions
34
+ #
35
+ attr_accessor :data_source
36
+ #
37
+ attr_accessor :file_info
38
+ #
39
+ attr_accessor :worksheet
40
+ #
41
+ attr_accessor :ranged__table
42
+ #
43
+ attr_accessor :chart_index
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'data_source' => :'DataSource',
49
+ :'file_info' => :'FileInfo',
50
+ :'worksheet' => :'Worksheet',
51
+ :'ranged__table' => :'Ranged_Table',
52
+ :'chart_index' => :'ChartIndex'
53
+ }
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.swagger_types
58
+ {
59
+ :'data_source' => :'DataSource',
60
+ :'file_info' => :'FileInfo',
61
+ :'worksheet' => :'String',
62
+ :'ranged__table' => :'String',
63
+ :'chart_index' => :'Integer'
64
+ }
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
74
+
75
+ if attributes.has_key?(:'DataSource')
76
+ self.data_source = attributes[:'DataSource']
77
+ end
78
+ if attributes.has_key?(:'FileInfo')
79
+ self.file_info = attributes[:'FileInfo']
80
+ end
81
+ if attributes.has_key?(:'Worksheet')
82
+ self.worksheet = attributes[:'Worksheet']
83
+ end
84
+ if attributes.has_key?(:'Ranged_Table')
85
+ self.ranged__table = attributes[:'Ranged_Table']
86
+ end
87
+ if attributes.has_key?(:'ChartIndex')
88
+ self.chart_index = attributes[:'ChartIndex']
89
+ end
90
+
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properies with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ if @data_source.nil?
98
+ invalid_properties.push("invalid value for 'data_source', data_source cannot be nil.")
99
+ end
100
+ if @file_info.nil?
101
+ invalid_properties.push("invalid value for 'file_info', file_info cannot be nil.")
102
+ end
103
+ if @worksheet.nil?
104
+ invalid_properties.push("invalid value for 'worksheet', worksheet cannot be nil.")
105
+ end
106
+ if @ranged__table.nil?
107
+ invalid_properties.push("invalid value for 'ranged__table', ranged__table cannot be nil.")
108
+ end
109
+ if @chart_index.nil?
110
+ invalid_properties.push("invalid value for 'chart_index', chart_index cannot be nil.")
111
+ end
112
+
113
+ return invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ return false if @data_source.nil?
120
+ return false if @file_info.nil?
121
+ return false if @worksheet.nil?
122
+ return false if @ranged__table.nil?
123
+ return false if @chart_index.nil?
124
+ return true
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ data_source == o.data_source &&
133
+ file_info == o.file_info &&
134
+ worksheet == o.worksheet &&
135
+ ranged__table == o.ranged__table &&
136
+ chart_index == o.chart_index
137
+ std_dev == o.std_dev
138
+ end
139
+
140
+ # @see the `==` method
141
+ # @param [Object] Object to be compared
142
+ def eql?(o)
143
+ self == o
144
+ end
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Fixnum] Hash code
148
+ def hash
149
+ [ data_source , file_info , worksheet , ranged__table , chart_index ].hash
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ self.class.swagger_types.each_pair do |key, type|
158
+ if type =~ /\AArray<(.*)>/i
159
+ # check to ensure the input is an array given that the the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
163
+ end
164
+ elsif !attributes[self.class.attribute_map[key]].nil?
165
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
166
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
167
+ end
168
+
169
+ self
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def _deserialize(type, value)
177
+ case type.to_sym
178
+ when :DateTime
179
+ DateTime.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :BOOLEAN
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ temp_model = AsposeCellsCloud.const_get(type).new
210
+ temp_model.build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map{ |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+
258
+ end