cloudmersive-configuration-api-client 1.7.2 → 2.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 (72) hide show
  1. checksums.yaml +4 -4
  2. metadata +3 -73
  3. data/Gemfile +0 -7
  4. data/README.md +0 -121
  5. data/Rakefile +0 -8
  6. data/cloudmersive-configuration-api-client.gemspec +0 -45
  7. data/docs/CreateSettingRequest.md +0 -14
  8. data/docs/CreateSettingResponse.md +0 -11
  9. data/docs/HttpFormDataParameter.md +0 -11
  10. data/docs/HttpGetParameter.md +0 -10
  11. data/docs/HttpOrchestrationHeader.md +0 -10
  12. data/docs/HttpOrchestrationRequest.md +0 -8
  13. data/docs/HttpOrchestrationResponse.md +0 -11
  14. data/docs/HttpOrchestrationTask.md +0 -16
  15. data/docs/HttpRawBinaryParameter.md +0 -9
  16. data/docs/HttpRawTextParameter.md +0 -9
  17. data/docs/HttpWwwFormUrlEncodedParameter.md +0 -10
  18. data/docs/ListSettingsRequest.md +0 -9
  19. data/docs/ListSettingsResponse.md +0 -8
  20. data/docs/OrchestratorApi.md +0 -61
  21. data/docs/SettingValue.md +0 -15
  22. data/docs/SettingsApi.md +0 -167
  23. data/docs/TaskOutputReference.md +0 -9
  24. data/docs/UpdateSettingRequest.md +0 -10
  25. data/docs/UpdateSettingResponse.md +0 -9
  26. data/git_push.sh +0 -55
  27. data/lib/cloudmersive-configuration-api-client.rb +0 -58
  28. data/lib/cloudmersive-configuration-api-client/api/orchestrator_api.rb +0 -78
  29. data/lib/cloudmersive-configuration-api-client/api/settings_api.rb +0 -188
  30. data/lib/cloudmersive-configuration-api-client/api_client.rb +0 -389
  31. data/lib/cloudmersive-configuration-api-client/api_error.rb +0 -38
  32. data/lib/cloudmersive-configuration-api-client/configuration.rb +0 -209
  33. data/lib/cloudmersive-configuration-api-client/models/create_setting_request.rb +0 -249
  34. data/lib/cloudmersive-configuration-api-client/models/create_setting_response.rb +0 -219
  35. data/lib/cloudmersive-configuration-api-client/models/http_form_data_parameter.rb +0 -235
  36. data/lib/cloudmersive-configuration-api-client/models/http_get_parameter.rb +0 -209
  37. data/lib/cloudmersive-configuration-api-client/models/http_orchestration_header.rb +0 -209
  38. data/lib/cloudmersive-configuration-api-client/models/http_orchestration_request.rb +0 -191
  39. data/lib/cloudmersive-configuration-api-client/models/http_orchestration_response.rb +0 -235
  40. data/lib/cloudmersive-configuration-api-client/models/http_orchestration_task.rb +0 -277
  41. data/lib/cloudmersive-configuration-api-client/models/http_raw_binary_parameter.rb +0 -215
  42. data/lib/cloudmersive-configuration-api-client/models/http_raw_text_parameter.rb +0 -199
  43. data/lib/cloudmersive-configuration-api-client/models/http_www_form_url_encoded_parameter.rb +0 -209
  44. data/lib/cloudmersive-configuration-api-client/models/list_settings_request.rb +0 -199
  45. data/lib/cloudmersive-configuration-api-client/models/list_settings_response.rb +0 -191
  46. data/lib/cloudmersive-configuration-api-client/models/setting_value.rb +0 -259
  47. data/lib/cloudmersive-configuration-api-client/models/task_output_reference.rb +0 -199
  48. data/lib/cloudmersive-configuration-api-client/models/update_setting_request.rb +0 -206
  49. data/lib/cloudmersive-configuration-api-client/models/update_setting_response.rb +0 -197
  50. data/lib/cloudmersive-configuration-api-client/version.rb +0 -15
  51. data/spec/api/orchestrator_api_spec.rb +0 -47
  52. data/spec/api/settings_api_spec.rb +0 -71
  53. data/spec/api_client_spec.rb +0 -226
  54. data/spec/configuration_spec.rb +0 -42
  55. data/spec/models/create_setting_request_spec.rb +0 -78
  56. data/spec/models/create_setting_response_spec.rb +0 -60
  57. data/spec/models/http_form_data_parameter_spec.rb +0 -60
  58. data/spec/models/http_get_parameter_spec.rb +0 -54
  59. data/spec/models/http_orchestration_header_spec.rb +0 -54
  60. data/spec/models/http_orchestration_request_spec.rb +0 -42
  61. data/spec/models/http_orchestration_response_spec.rb +0 -60
  62. data/spec/models/http_orchestration_task_spec.rb +0 -90
  63. data/spec/models/http_raw_binary_parameter_spec.rb +0 -48
  64. data/spec/models/http_raw_text_parameter_spec.rb +0 -48
  65. data/spec/models/http_www_form_url_encoded_parameter_spec.rb +0 -54
  66. data/spec/models/list_settings_request_spec.rb +0 -48
  67. data/spec/models/list_settings_response_spec.rb +0 -42
  68. data/spec/models/setting_value_spec.rb +0 -84
  69. data/spec/models/task_output_reference_spec.rb +0 -48
  70. data/spec/models/update_setting_request_spec.rb +0 -54
  71. data/spec/models/update_setting_response_spec.rb +0 -48
  72. data/spec/spec_helper.rb +0 -111
@@ -1,209 +0,0 @@
1
- =begin
2
- #configapi
3
-
4
- #Config API lets you easily manage configuration at scale.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveConfigurationApiClient
16
- # Query string parameter
17
- class HttpGetParameter
18
- # Name of the parameter
19
- attr_accessor :parameter_name
20
-
21
- # Value of the parameter
22
- attr_accessor :parameter_value
23
-
24
- # Optional; use the output from a previous task as the input to this parameter. Set to null (default) to ignore.
25
- attr_accessor :use_output_from_previous_task
26
-
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'parameter_name' => :'ParameterName',
32
- :'parameter_value' => :'ParameterValue',
33
- :'use_output_from_previous_task' => :'UseOutputFromPreviousTask'
34
- }
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.swagger_types
39
- {
40
- :'parameter_name' => :'String',
41
- :'parameter_value' => :'String',
42
- :'use_output_from_previous_task' => :'TaskOutputReference'
43
- }
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- return unless attributes.is_a?(Hash)
50
-
51
- # convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
-
54
- if attributes.has_key?(:'ParameterName')
55
- self.parameter_name = attributes[:'ParameterName']
56
- end
57
-
58
- if attributes.has_key?(:'ParameterValue')
59
- self.parameter_value = attributes[:'ParameterValue']
60
- end
61
-
62
- if attributes.has_key?(:'UseOutputFromPreviousTask')
63
- self.use_output_from_previous_task = attributes[:'UseOutputFromPreviousTask']
64
- end
65
-
66
- end
67
-
68
- # Show invalid properties with the reasons. Usually used together with valid?
69
- # @return Array for valid properties with the reasons
70
- def list_invalid_properties
71
- invalid_properties = Array.new
72
- return invalid_properties
73
- end
74
-
75
- # Check to see if the all the properties in the model are valid
76
- # @return true if the model is valid
77
- def valid?
78
- return true
79
- end
80
-
81
- # Checks equality by comparing each attribute.
82
- # @param [Object] Object to be compared
83
- def ==(o)
84
- return true if self.equal?(o)
85
- self.class == o.class &&
86
- parameter_name == o.parameter_name &&
87
- parameter_value == o.parameter_value &&
88
- use_output_from_previous_task == o.use_output_from_previous_task
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(o)
94
- self == o
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Fixnum] Hash code
99
- def hash
100
- [parameter_name, parameter_value, use_output_from_previous_task].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.swagger_types.each_pair do |key, type|
109
- if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
111
- # is documented as an array but the input is not
112
- if attributes[self.class.attribute_map[key]].is_a?(Array)
113
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
- end
115
- elsif !attributes[self.class.attribute_map[key]].nil?
116
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
- end # or else data not found in attributes(hash), not an issue as the data can be optional
118
- end
119
-
120
- self
121
- end
122
-
123
- # Deserializes the data based on type
124
- # @param string type Data type
125
- # @param string value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def _deserialize(type, value)
128
- case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :BOOLEAN
140
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- temp_model = CloudmersiveConfigurationApiClient.const_get(type).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
-
165
- # Returns the string representation of the object
166
- # @return [String] String presentation of the object
167
- def to_s
168
- to_hash.to_s
169
- end
170
-
171
- # to_body is an alias to to_hash (backward compatibility)
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_body
174
- to_hash
175
- end
176
-
177
- # Returns the object in the form of hash
178
- # @return [Hash] Returns the object in the form of hash
179
- def to_hash
180
- hash = {}
181
- self.class.attribute_map.each_pair do |attr, param|
182
- value = self.send(attr)
183
- next if value.nil?
184
- hash[param] = _to_hash(value)
185
- end
186
- hash
187
- end
188
-
189
- # Outputs non-array value in the form of hash
190
- # For object, use to_hash. Otherwise, just return the value
191
- # @param [Object] value Any valid value
192
- # @return [Hash] Returns the value in the form of hash
193
- def _to_hash(value)
194
- if value.is_a?(Array)
195
- value.compact.map{ |v| _to_hash(v) }
196
- elsif value.is_a?(Hash)
197
- {}.tap do |hash|
198
- value.each { |k, v| hash[k] = _to_hash(v) }
199
- end
200
- elsif value.respond_to? :to_hash
201
- value.to_hash
202
- else
203
- value
204
- end
205
- end
206
-
207
- end
208
-
209
- end
@@ -1,209 +0,0 @@
1
- =begin
2
- #configapi
3
-
4
- #Config API lets you easily manage configuration at scale.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveConfigurationApiClient
16
- # HTTP header to add to the HTTP request
17
- class HttpOrchestrationHeader
18
- # Name of the HTTP header, e.g. \"Content-Type\"
19
- attr_accessor :header_name
20
-
21
- # Value of the HTTP header
22
- attr_accessor :header_value
23
-
24
- # Optional; use the output from a previous task as the input to this parameter. Set to null (default) to ignore.
25
- attr_accessor :use_output_from_previous_task
26
-
27
-
28
- # Attribute mapping from ruby-style variable name to JSON key.
29
- def self.attribute_map
30
- {
31
- :'header_name' => :'HeaderName',
32
- :'header_value' => :'HeaderValue',
33
- :'use_output_from_previous_task' => :'UseOutputFromPreviousTask'
34
- }
35
- end
36
-
37
- # Attribute type mapping.
38
- def self.swagger_types
39
- {
40
- :'header_name' => :'String',
41
- :'header_value' => :'String',
42
- :'use_output_from_previous_task' => :'TaskOutputReference'
43
- }
44
- end
45
-
46
- # Initializes the object
47
- # @param [Hash] attributes Model attributes in the form of hash
48
- def initialize(attributes = {})
49
- return unless attributes.is_a?(Hash)
50
-
51
- # convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
53
-
54
- if attributes.has_key?(:'HeaderName')
55
- self.header_name = attributes[:'HeaderName']
56
- end
57
-
58
- if attributes.has_key?(:'HeaderValue')
59
- self.header_value = attributes[:'HeaderValue']
60
- end
61
-
62
- if attributes.has_key?(:'UseOutputFromPreviousTask')
63
- self.use_output_from_previous_task = attributes[:'UseOutputFromPreviousTask']
64
- end
65
-
66
- end
67
-
68
- # Show invalid properties with the reasons. Usually used together with valid?
69
- # @return Array for valid properties with the reasons
70
- def list_invalid_properties
71
- invalid_properties = Array.new
72
- return invalid_properties
73
- end
74
-
75
- # Check to see if the all the properties in the model are valid
76
- # @return true if the model is valid
77
- def valid?
78
- return true
79
- end
80
-
81
- # Checks equality by comparing each attribute.
82
- # @param [Object] Object to be compared
83
- def ==(o)
84
- return true if self.equal?(o)
85
- self.class == o.class &&
86
- header_name == o.header_name &&
87
- header_value == o.header_value &&
88
- use_output_from_previous_task == o.use_output_from_previous_task
89
- end
90
-
91
- # @see the `==` method
92
- # @param [Object] Object to be compared
93
- def eql?(o)
94
- self == o
95
- end
96
-
97
- # Calculates hash code according to all attributes.
98
- # @return [Fixnum] Hash code
99
- def hash
100
- [header_name, header_value, use_output_from_previous_task].hash
101
- end
102
-
103
- # Builds the object from hash
104
- # @param [Hash] attributes Model attributes in the form of hash
105
- # @return [Object] Returns the model itself
106
- def build_from_hash(attributes)
107
- return nil unless attributes.is_a?(Hash)
108
- self.class.swagger_types.each_pair do |key, type|
109
- if type =~ /\AArray<(.*)>/i
110
- # check to ensure the input is an array given that the the attribute
111
- # is documented as an array but the input is not
112
- if attributes[self.class.attribute_map[key]].is_a?(Array)
113
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
114
- end
115
- elsif !attributes[self.class.attribute_map[key]].nil?
116
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
117
- end # or else data not found in attributes(hash), not an issue as the data can be optional
118
- end
119
-
120
- self
121
- end
122
-
123
- # Deserializes the data based on type
124
- # @param string type Data type
125
- # @param string value Value to be deserialized
126
- # @return [Object] Deserialized data
127
- def _deserialize(type, value)
128
- case type.to_sym
129
- when :DateTime
130
- DateTime.parse(value)
131
- when :Date
132
- Date.parse(value)
133
- when :String
134
- value.to_s
135
- when :Integer
136
- value.to_i
137
- when :Float
138
- value.to_f
139
- when :BOOLEAN
140
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
141
- true
142
- else
143
- false
144
- end
145
- when :Object
146
- # generic object (usually a Hash), return directly
147
- value
148
- when /\AArray<(?<inner_type>.+)>\z/
149
- inner_type = Regexp.last_match[:inner_type]
150
- value.map { |v| _deserialize(inner_type, v) }
151
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
152
- k_type = Regexp.last_match[:k_type]
153
- v_type = Regexp.last_match[:v_type]
154
- {}.tap do |hash|
155
- value.each do |k, v|
156
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
157
- end
158
- end
159
- else # model
160
- temp_model = CloudmersiveConfigurationApiClient.const_get(type).new
161
- temp_model.build_from_hash(value)
162
- end
163
- end
164
-
165
- # Returns the string representation of the object
166
- # @return [String] String presentation of the object
167
- def to_s
168
- to_hash.to_s
169
- end
170
-
171
- # to_body is an alias to to_hash (backward compatibility)
172
- # @return [Hash] Returns the object in the form of hash
173
- def to_body
174
- to_hash
175
- end
176
-
177
- # Returns the object in the form of hash
178
- # @return [Hash] Returns the object in the form of hash
179
- def to_hash
180
- hash = {}
181
- self.class.attribute_map.each_pair do |attr, param|
182
- value = self.send(attr)
183
- next if value.nil?
184
- hash[param] = _to_hash(value)
185
- end
186
- hash
187
- end
188
-
189
- # Outputs non-array value in the form of hash
190
- # For object, use to_hash. Otherwise, just return the value
191
- # @param [Object] value Any valid value
192
- # @return [Hash] Returns the value in the form of hash
193
- def _to_hash(value)
194
- if value.is_a?(Array)
195
- value.compact.map{ |v| _to_hash(v) }
196
- elsif value.is_a?(Hash)
197
- {}.tap do |hash|
198
- value.each { |k, v| hash[k] = _to_hash(v) }
199
- end
200
- elsif value.respond_to? :to_hash
201
- value.to_hash
202
- else
203
- value
204
- end
205
- end
206
-
207
- end
208
-
209
- end
@@ -1,191 +0,0 @@
1
- =begin
2
- #configapi
3
-
4
- #Config API lets you easily manage configuration at scale.
5
-
6
- OpenAPI spec version: v1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.3.1
10
-
11
- =end
12
-
13
- require 'date'
14
-
15
- module CloudmersiveConfigurationApiClient
16
- # HTTP Orchestration request
17
- class HttpOrchestrationRequest
18
- # Tasks to perform, in the order you wish to perform them
19
- attr_accessor :http_tasks
20
-
21
-
22
- # Attribute mapping from ruby-style variable name to JSON key.
23
- def self.attribute_map
24
- {
25
- :'http_tasks' => :'HttpTasks'
26
- }
27
- end
28
-
29
- # Attribute type mapping.
30
- def self.swagger_types
31
- {
32
- :'http_tasks' => :'Array<HttpOrchestrationTask>'
33
- }
34
- end
35
-
36
- # Initializes the object
37
- # @param [Hash] attributes Model attributes in the form of hash
38
- def initialize(attributes = {})
39
- return unless attributes.is_a?(Hash)
40
-
41
- # convert string to symbol for hash key
42
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
43
-
44
- if attributes.has_key?(:'HttpTasks')
45
- if (value = attributes[:'HttpTasks']).is_a?(Array)
46
- self.http_tasks = value
47
- end
48
- end
49
-
50
- end
51
-
52
- # Show invalid properties with the reasons. Usually used together with valid?
53
- # @return Array for valid properties with the reasons
54
- def list_invalid_properties
55
- invalid_properties = Array.new
56
- return invalid_properties
57
- end
58
-
59
- # Check to see if the all the properties in the model are valid
60
- # @return true if the model is valid
61
- def valid?
62
- return true
63
- end
64
-
65
- # Checks equality by comparing each attribute.
66
- # @param [Object] Object to be compared
67
- def ==(o)
68
- return true if self.equal?(o)
69
- self.class == o.class &&
70
- http_tasks == o.http_tasks
71
- end
72
-
73
- # @see the `==` method
74
- # @param [Object] Object to be compared
75
- def eql?(o)
76
- self == o
77
- end
78
-
79
- # Calculates hash code according to all attributes.
80
- # @return [Fixnum] Hash code
81
- def hash
82
- [http_tasks].hash
83
- end
84
-
85
- # Builds the object from hash
86
- # @param [Hash] attributes Model attributes in the form of hash
87
- # @return [Object] Returns the model itself
88
- def build_from_hash(attributes)
89
- return nil unless attributes.is_a?(Hash)
90
- self.class.swagger_types.each_pair do |key, type|
91
- if type =~ /\AArray<(.*)>/i
92
- # check to ensure the input is an array given that the the attribute
93
- # is documented as an array but the input is not
94
- if attributes[self.class.attribute_map[key]].is_a?(Array)
95
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
96
- end
97
- elsif !attributes[self.class.attribute_map[key]].nil?
98
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
99
- end # or else data not found in attributes(hash), not an issue as the data can be optional
100
- end
101
-
102
- self
103
- end
104
-
105
- # Deserializes the data based on type
106
- # @param string type Data type
107
- # @param string value Value to be deserialized
108
- # @return [Object] Deserialized data
109
- def _deserialize(type, value)
110
- case type.to_sym
111
- when :DateTime
112
- DateTime.parse(value)
113
- when :Date
114
- Date.parse(value)
115
- when :String
116
- value.to_s
117
- when :Integer
118
- value.to_i
119
- when :Float
120
- value.to_f
121
- when :BOOLEAN
122
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
123
- true
124
- else
125
- false
126
- end
127
- when :Object
128
- # generic object (usually a Hash), return directly
129
- value
130
- when /\AArray<(?<inner_type>.+)>\z/
131
- inner_type = Regexp.last_match[:inner_type]
132
- value.map { |v| _deserialize(inner_type, v) }
133
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
134
- k_type = Regexp.last_match[:k_type]
135
- v_type = Regexp.last_match[:v_type]
136
- {}.tap do |hash|
137
- value.each do |k, v|
138
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
139
- end
140
- end
141
- else # model
142
- temp_model = CloudmersiveConfigurationApiClient.const_get(type).new
143
- temp_model.build_from_hash(value)
144
- end
145
- end
146
-
147
- # Returns the string representation of the object
148
- # @return [String] String presentation of the object
149
- def to_s
150
- to_hash.to_s
151
- end
152
-
153
- # to_body is an alias to to_hash (backward compatibility)
154
- # @return [Hash] Returns the object in the form of hash
155
- def to_body
156
- to_hash
157
- end
158
-
159
- # Returns the object in the form of hash
160
- # @return [Hash] Returns the object in the form of hash
161
- def to_hash
162
- hash = {}
163
- self.class.attribute_map.each_pair do |attr, param|
164
- value = self.send(attr)
165
- next if value.nil?
166
- hash[param] = _to_hash(value)
167
- end
168
- hash
169
- end
170
-
171
- # Outputs non-array value in the form of hash
172
- # For object, use to_hash. Otherwise, just return the value
173
- # @param [Object] value Any valid value
174
- # @return [Hash] Returns the value in the form of hash
175
- def _to_hash(value)
176
- if value.is_a?(Array)
177
- value.compact.map{ |v| _to_hash(v) }
178
- elsif value.is_a?(Hash)
179
- {}.tap do |hash|
180
- value.each { |k, v| hash[k] = _to_hash(v) }
181
- end
182
- elsif value.respond_to? :to_hash
183
- value.to_hash
184
- else
185
- value
186
- end
187
- end
188
-
189
- end
190
-
191
- end