aspose_words_cloud 22.1.0 → 22.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose_words_cloud/api_client.rb +1 -0
- data/lib/aspose_words_cloud/models/bmp_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/doc_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/{ooxml_save_options_data.rb → docm_save_options_data.rb} +15 -17
- data/lib/aspose_words_cloud/models/docx_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/dot_save_options_data.rb +426 -0
- data/lib/aspose_words_cloud/models/dotm_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/dotx_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/emf_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/epub_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/flat_opc_macro_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/{txt_save_options_base_data.rb → flat_opc_save_options_data.rb} +50 -54
- data/lib/aspose_words_cloud/models/flat_opc_template_macro_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/flat_opc_template_save_options_data.rb +440 -0
- data/lib/aspose_words_cloud/models/gif_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/html_fixed_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/html_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/jpeg_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/markdown_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/mhtml_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/odt_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/{fixed_page_save_options_data.rb → open_xps_save_options_data.rb} +55 -17
- data/lib/aspose_words_cloud/models/ott_save_options_data.rb +441 -0
- data/lib/aspose_words_cloud/models/pcl_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/png_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/ps_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/rtf_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/svg_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/text_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/tiff_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/models/word_ml_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/xaml_fixed_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/{save_options_data.rb → xaml_flow_pack_save_options_data.rb} +35 -17
- data/lib/aspose_words_cloud/models/xaml_flow_save_options_data.rb +12 -14
- data/lib/aspose_words_cloud/models/xps_save_options_data.rb +9 -11
- data/lib/aspose_words_cloud/version.rb +1 -1
- data/lib/aspose_words_cloud.rb +12 -10
- metadata +14 -12
- data/lib/aspose_words_cloud/models/comment_base.rb +0 -251
- data/lib/aspose_words_cloud/models/document_property_base.rb +0 -201
- data/lib/aspose_words_cloud/models/field_base.rb +0 -211
- data/lib/aspose_words_cloud/models/footnote_base.rb +0 -273
- data/lib/aspose_words_cloud/models/image_save_options_data.rb +0 -585
- data/lib/aspose_words_cloud/models/run_base.rb +0 -201
@@ -1,211 +0,0 @@
|
|
1
|
-
# ------------------------------------------------------------------------------------
|
2
|
-
# <copyright company="Aspose" file="field_base.rb">
|
3
|
-
# Copyright (c) 2022 Aspose.Words for Cloud
|
4
|
-
# </copyright>
|
5
|
-
# <summary>
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
# of this software and associated documentation files (the "Software"), to deal
|
8
|
-
# in the Software without restriction, including without limitation the rights
|
9
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
-
# copies of the Software, and to permit persons to whom the Software is
|
11
|
-
# furnished to do so, subject to the following conditions:
|
12
|
-
#
|
13
|
-
# The above copyright notice and this permission notice shall be included in all
|
14
|
-
# copies or substantial portions of the Software.
|
15
|
-
#
|
16
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
-
# SOFTWARE.
|
23
|
-
# </summary>
|
24
|
-
# ------------------------------------------------------------------------------------
|
25
|
-
|
26
|
-
require 'date'
|
27
|
-
|
28
|
-
module AsposeWordsCloud
|
29
|
-
|
30
|
-
# Field.
|
31
|
-
class FieldBase
|
32
|
-
# Gets or sets the field code.
|
33
|
-
attr_accessor :field_code
|
34
|
-
|
35
|
-
# Gets or sets the LCID of the field.
|
36
|
-
attr_accessor :locale_id
|
37
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
38
|
-
def self.attribute_map
|
39
|
-
{
|
40
|
-
:'field_code' => :'FieldCode',
|
41
|
-
:'locale_id' => :'LocaleId'
|
42
|
-
}
|
43
|
-
end
|
44
|
-
|
45
|
-
# Attribute type mapping.
|
46
|
-
def self.swagger_types
|
47
|
-
{
|
48
|
-
:'field_code' => :'String',
|
49
|
-
:'locale_id' => :'String'
|
50
|
-
}
|
51
|
-
end
|
52
|
-
|
53
|
-
# Initializes the object
|
54
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
-
def initialize(attributes = {})
|
56
|
-
return unless attributes.is_a?(Hash)
|
57
|
-
|
58
|
-
# convert string to symbol for hash key
|
59
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
60
|
-
|
61
|
-
if attributes.key?(:'FieldCode')
|
62
|
-
self.field_code = attributes[:'FieldCode']
|
63
|
-
end
|
64
|
-
|
65
|
-
if attributes.key?(:'LocaleId')
|
66
|
-
self.locale_id = attributes[:'LocaleId']
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
71
|
-
# @return Array for valid properies with the reasons
|
72
|
-
def list_invalid_properties
|
73
|
-
invalid_properties = []
|
74
|
-
return invalid_properties
|
75
|
-
end
|
76
|
-
|
77
|
-
# Check to see if the all the properties in the model are valid
|
78
|
-
# @return true if the model is valid
|
79
|
-
def valid?
|
80
|
-
return true
|
81
|
-
end
|
82
|
-
|
83
|
-
# Checks equality by comparing each attribute.
|
84
|
-
# @param [Object] Object to be compared
|
85
|
-
def ==(other)
|
86
|
-
return true if self.equal?(other)
|
87
|
-
self.class == other.class &&
|
88
|
-
field_code == other.field_code &&
|
89
|
-
locale_id == other.locale_id
|
90
|
-
end
|
91
|
-
|
92
|
-
# @see the `==` method
|
93
|
-
# @param [Object] Object to be compared
|
94
|
-
def eql?(other)
|
95
|
-
self == other
|
96
|
-
end
|
97
|
-
|
98
|
-
# Calculates hash code according to all attributes.
|
99
|
-
# @return [Fixnum] Hash code
|
100
|
-
def hash
|
101
|
-
[field_code, locale_id].hash
|
102
|
-
end
|
103
|
-
|
104
|
-
# Builds the object from hash
|
105
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
-
# @return [Object] Returns the model itself
|
107
|
-
def build_from_hash(attributes)
|
108
|
-
return nil unless attributes.is_a?(Hash)
|
109
|
-
self.class.swagger_types.each_pair do |key, type|
|
110
|
-
if type =~ /\AArray<(.*)>/i
|
111
|
-
# check to ensure the input is an array given that the the attribute
|
112
|
-
# is documented as an array but the input is not
|
113
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
115
|
-
end
|
116
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
-
end
|
119
|
-
# or else data not found in attributes(hash), not an issue as the data can be optional
|
120
|
-
end
|
121
|
-
|
122
|
-
self
|
123
|
-
end
|
124
|
-
|
125
|
-
# Deserializes the data based on type
|
126
|
-
# @param string type Data type
|
127
|
-
# @param string value Value to be deserialized
|
128
|
-
# @return [Object] Deserialized data
|
129
|
-
def _deserialize(type, value)
|
130
|
-
case type.to_sym
|
131
|
-
when :DateTime
|
132
|
-
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
133
|
-
when :Date
|
134
|
-
Time.at(/\d/.match(value)[0].to_f).to_date
|
135
|
-
when :String
|
136
|
-
value.to_s
|
137
|
-
when :Integer
|
138
|
-
value.to_i
|
139
|
-
when :Float
|
140
|
-
value.to_f
|
141
|
-
when :BOOLEAN
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
143
|
-
true
|
144
|
-
else
|
145
|
-
false
|
146
|
-
end
|
147
|
-
when :Object
|
148
|
-
# generic object (usually a Hash), return directly
|
149
|
-
value
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
156
|
-
{}.tap do |hash|
|
157
|
-
value.each do |k, v|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
159
|
-
end
|
160
|
-
end
|
161
|
-
else
|
162
|
-
# model
|
163
|
-
temp_model = AsposeWordsCloud.const_get(type).new
|
164
|
-
temp_model.build_from_hash(value)
|
165
|
-
end
|
166
|
-
end
|
167
|
-
|
168
|
-
# Returns the string representation of the object
|
169
|
-
# @return [String] String presentation of the object
|
170
|
-
def to_s
|
171
|
-
to_hash.to_s
|
172
|
-
end
|
173
|
-
|
174
|
-
# to_body is an alias to to_hash (backward compatibility)
|
175
|
-
# @return [Hash] Returns the object in the form of hash
|
176
|
-
def to_body
|
177
|
-
to_hash
|
178
|
-
end
|
179
|
-
|
180
|
-
# Returns the object in the form of hash
|
181
|
-
# @return [Hash] Returns the object in the form of hash
|
182
|
-
def to_hash
|
183
|
-
hash = {}
|
184
|
-
self.class.attribute_map.each_pair do |attr, param|
|
185
|
-
value = self.send(attr)
|
186
|
-
next if value.nil?
|
187
|
-
hash[param] = _to_hash(value)
|
188
|
-
end
|
189
|
-
hash
|
190
|
-
end
|
191
|
-
|
192
|
-
# Outputs non-array value in the form of hash
|
193
|
-
# For object, use to_hash. Otherwise, just return the value
|
194
|
-
# @param [Object] value Any valid value
|
195
|
-
# @return [Hash] Returns the value in the form of hash
|
196
|
-
def _to_hash(value)
|
197
|
-
if value.is_a?(Array)
|
198
|
-
value.compact.map { |v| _to_hash(v) }
|
199
|
-
elsif value.is_a?(Hash)
|
200
|
-
{}.tap do |hash|
|
201
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
202
|
-
end
|
203
|
-
elsif value.respond_to? :to_hash
|
204
|
-
value.to_hash
|
205
|
-
else
|
206
|
-
value
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
end
|
211
|
-
end
|
@@ -1,273 +0,0 @@
|
|
1
|
-
# ------------------------------------------------------------------------------------
|
2
|
-
# <copyright company="Aspose" file="footnote_base.rb">
|
3
|
-
# Copyright (c) 2022 Aspose.Words for Cloud
|
4
|
-
# </copyright>
|
5
|
-
# <summary>
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
-
# of this software and associated documentation files (the "Software"), to deal
|
8
|
-
# in the Software without restriction, including without limitation the rights
|
9
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
-
# copies of the Software, and to permit persons to whom the Software is
|
11
|
-
# furnished to do so, subject to the following conditions:
|
12
|
-
#
|
13
|
-
# The above copyright notice and this permission notice shall be included in all
|
14
|
-
# copies or substantial portions of the Software.
|
15
|
-
#
|
16
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
-
# SOFTWARE.
|
23
|
-
# </summary>
|
24
|
-
# ------------------------------------------------------------------------------------
|
25
|
-
|
26
|
-
require 'date'
|
27
|
-
|
28
|
-
module AsposeWordsCloud
|
29
|
-
|
30
|
-
# Footnote base class.
|
31
|
-
class FootnoteBase
|
32
|
-
# Gets or sets the option, that specifies whether this is a footnote or endnote.
|
33
|
-
attr_accessor :footnote_type
|
34
|
-
|
35
|
-
# Gets or sets the link to comment range start node.
|
36
|
-
attr_accessor :position
|
37
|
-
|
38
|
-
# Gets or sets the custom reference mark to be used for this footnote.
|
39
|
-
# Default value is Empty, meaning auto-numbered footnotes are used.
|
40
|
-
attr_accessor :reference_mark
|
41
|
-
|
42
|
-
# Gets or sets text of the footnote.
|
43
|
-
attr_accessor :text
|
44
|
-
|
45
|
-
class EnumAttributeValidator
|
46
|
-
attr_reader :datatype
|
47
|
-
attr_reader :allowable_values
|
48
|
-
|
49
|
-
def initialize(datatype, allowable_values)
|
50
|
-
@allowable_values = allowable_values.map do |value|
|
51
|
-
case datatype.to_s
|
52
|
-
when /Integer/i
|
53
|
-
value.to_i
|
54
|
-
when /Float/i
|
55
|
-
value.to_f
|
56
|
-
else
|
57
|
-
value
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def valid?(value)
|
63
|
-
!value || allowable_values.include?(value)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
68
|
-
def self.attribute_map
|
69
|
-
{
|
70
|
-
:'footnote_type' => :'FootnoteType',
|
71
|
-
:'position' => :'Position',
|
72
|
-
:'reference_mark' => :'ReferenceMark',
|
73
|
-
:'text' => :'Text'
|
74
|
-
}
|
75
|
-
end
|
76
|
-
|
77
|
-
# Attribute type mapping.
|
78
|
-
def self.swagger_types
|
79
|
-
{
|
80
|
-
:'footnote_type' => :'String',
|
81
|
-
:'position' => :'DocumentPosition',
|
82
|
-
:'reference_mark' => :'String',
|
83
|
-
:'text' => :'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.key?(:'FootnoteType')
|
96
|
-
self.footnote_type = attributes[:'FootnoteType']
|
97
|
-
end
|
98
|
-
|
99
|
-
if attributes.key?(:'Position')
|
100
|
-
self.position = attributes[:'Position']
|
101
|
-
end
|
102
|
-
|
103
|
-
if attributes.key?(:'ReferenceMark')
|
104
|
-
self.reference_mark = attributes[:'ReferenceMark']
|
105
|
-
end
|
106
|
-
|
107
|
-
if attributes.key?(:'Text')
|
108
|
-
self.text = attributes[:'Text']
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
113
|
-
# @return Array for valid properies with the reasons
|
114
|
-
def list_invalid_properties
|
115
|
-
invalid_properties = []
|
116
|
-
return invalid_properties
|
117
|
-
end
|
118
|
-
|
119
|
-
# Check to see if the all the properties in the model are valid
|
120
|
-
# @return true if the model is valid
|
121
|
-
def valid?
|
122
|
-
footnote_type_validator = EnumAttributeValidator.new('String', ["Footnote", "Endnote"])
|
123
|
-
return false unless footnote_type_validator.valid?(@footnote_type)
|
124
|
-
|
125
|
-
return true
|
126
|
-
end
|
127
|
-
|
128
|
-
# Custom attribute writer method checking allowed values (enum).
|
129
|
-
# @param [Object] footnote_type Object to be assigned
|
130
|
-
def footnote_type=(footnote_type)
|
131
|
-
validator = EnumAttributeValidator.new('String', ["Footnote", "Endnote"])
|
132
|
-
if footnote_type.to_i == 0
|
133
|
-
unless validator.valid?(footnote_type)
|
134
|
-
raise ArgumentError, "invalid value for 'footnote_type', must be one of #{validator.allowable_values}."
|
135
|
-
end
|
136
|
-
@footnote_type = footnote_type
|
137
|
-
else
|
138
|
-
@footnote_type = validator.allowable_values[footnote_type.to_i]
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
|
143
|
-
# Checks equality by comparing each attribute.
|
144
|
-
# @param [Object] Object to be compared
|
145
|
-
def ==(other)
|
146
|
-
return true if self.equal?(other)
|
147
|
-
self.class == other.class &&
|
148
|
-
footnote_type == other.footnote_type &&
|
149
|
-
position == other.position &&
|
150
|
-
reference_mark == other.reference_mark &&
|
151
|
-
text == other.text
|
152
|
-
end
|
153
|
-
|
154
|
-
# @see the `==` method
|
155
|
-
# @param [Object] Object to be compared
|
156
|
-
def eql?(other)
|
157
|
-
self == other
|
158
|
-
end
|
159
|
-
|
160
|
-
# Calculates hash code according to all attributes.
|
161
|
-
# @return [Fixnum] Hash code
|
162
|
-
def hash
|
163
|
-
[footnote_type, position, reference_mark, text].hash
|
164
|
-
end
|
165
|
-
|
166
|
-
# Builds the object from hash
|
167
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
168
|
-
# @return [Object] Returns the model itself
|
169
|
-
def build_from_hash(attributes)
|
170
|
-
return nil unless attributes.is_a?(Hash)
|
171
|
-
self.class.swagger_types.each_pair do |key, type|
|
172
|
-
if type =~ /\AArray<(.*)>/i
|
173
|
-
# check to ensure the input is an array given that the the attribute
|
174
|
-
# is documented as an array but the input is not
|
175
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
176
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
177
|
-
end
|
178
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
179
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
180
|
-
end
|
181
|
-
# or else data not found in attributes(hash), not an issue as the data can be optional
|
182
|
-
end
|
183
|
-
|
184
|
-
self
|
185
|
-
end
|
186
|
-
|
187
|
-
# Deserializes the data based on type
|
188
|
-
# @param string type Data type
|
189
|
-
# @param string value Value to be deserialized
|
190
|
-
# @return [Object] Deserialized data
|
191
|
-
def _deserialize(type, value)
|
192
|
-
case type.to_sym
|
193
|
-
when :DateTime
|
194
|
-
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
195
|
-
when :Date
|
196
|
-
Time.at(/\d/.match(value)[0].to_f).to_date
|
197
|
-
when :String
|
198
|
-
value.to_s
|
199
|
-
when :Integer
|
200
|
-
value.to_i
|
201
|
-
when :Float
|
202
|
-
value.to_f
|
203
|
-
when :BOOLEAN
|
204
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
205
|
-
true
|
206
|
-
else
|
207
|
-
false
|
208
|
-
end
|
209
|
-
when :Object
|
210
|
-
# generic object (usually a Hash), return directly
|
211
|
-
value
|
212
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
213
|
-
inner_type = Regexp.last_match[:inner_type]
|
214
|
-
value.map { |v| _deserialize(inner_type, v) }
|
215
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
216
|
-
k_type = Regexp.last_match[:k_type]
|
217
|
-
v_type = Regexp.last_match[:v_type]
|
218
|
-
{}.tap do |hash|
|
219
|
-
value.each do |k, v|
|
220
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
221
|
-
end
|
222
|
-
end
|
223
|
-
else
|
224
|
-
# model
|
225
|
-
temp_model = AsposeWordsCloud.const_get(type).new
|
226
|
-
temp_model.build_from_hash(value)
|
227
|
-
end
|
228
|
-
end
|
229
|
-
|
230
|
-
# Returns the string representation of the object
|
231
|
-
# @return [String] String presentation of the object
|
232
|
-
def to_s
|
233
|
-
to_hash.to_s
|
234
|
-
end
|
235
|
-
|
236
|
-
# to_body is an alias to to_hash (backward compatibility)
|
237
|
-
# @return [Hash] Returns the object in the form of hash
|
238
|
-
def to_body
|
239
|
-
to_hash
|
240
|
-
end
|
241
|
-
|
242
|
-
# Returns the object in the form of hash
|
243
|
-
# @return [Hash] Returns the object in the form of hash
|
244
|
-
def to_hash
|
245
|
-
hash = {}
|
246
|
-
self.class.attribute_map.each_pair do |attr, param|
|
247
|
-
value = self.send(attr)
|
248
|
-
next if value.nil?
|
249
|
-
hash[param] = _to_hash(value)
|
250
|
-
end
|
251
|
-
hash
|
252
|
-
end
|
253
|
-
|
254
|
-
# Outputs non-array value in the form of hash
|
255
|
-
# For object, use to_hash. Otherwise, just return the value
|
256
|
-
# @param [Object] value Any valid value
|
257
|
-
# @return [Hash] Returns the value in the form of hash
|
258
|
-
def _to_hash(value)
|
259
|
-
if value.is_a?(Array)
|
260
|
-
value.compact.map { |v| _to_hash(v) }
|
261
|
-
elsif value.is_a?(Hash)
|
262
|
-
{}.tap do |hash|
|
263
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
264
|
-
end
|
265
|
-
elsif value.respond_to? :to_hash
|
266
|
-
value.to_hash
|
267
|
-
else
|
268
|
-
value
|
269
|
-
end
|
270
|
-
end
|
271
|
-
|
272
|
-
end
|
273
|
-
end
|