Class: AsposeWordsCloud::TableProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_words_cloud/models/table_properties.rb

Overview

DTO container with table properties.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TableProperties

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 144

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.key?(:'Link')
    self.link = attributes[:'Link']
  end

  if attributes.key?(:'Alignment')
    self.alignment = attributes[:'Alignment']
  end

  if attributes.key?(:'AllowAutoFit')
    self.allow_auto_fit = attributes[:'AllowAutoFit']
  end

  if attributes.key?(:'Bidi')
    self.bidi = attributes[:'Bidi']
  end

  if attributes.key?(:'BottomPadding')
    self.bottom_padding = attributes[:'BottomPadding']
  end

  if attributes.key?(:'CellSpacing')
    self.cell_spacing = attributes[:'CellSpacing']
  end

  if attributes.key?(:'LeftIndent')
    self.left_indent = attributes[:'LeftIndent']
  end

  if attributes.key?(:'LeftPadding')
    self.left_padding = attributes[:'LeftPadding']
  end

  if attributes.key?(:'PreferredWidth')
    self.preferred_width = attributes[:'PreferredWidth']
  end

  if attributes.key?(:'RightPadding')
    self.right_padding = attributes[:'RightPadding']
  end

  if attributes.key?(:'StyleIdentifier')
    self.style_identifier = attributes[:'StyleIdentifier']
  end

  if attributes.key?(:'StyleName')
    self.style_name = attributes[:'StyleName']
  end

  if attributes.key?(:'StyleOptions')
    self.style_options = attributes[:'StyleOptions']
  end

  if attributes.key?(:'TextWrapping')
    self.text_wrapping = attributes[:'TextWrapping']
  end

  if attributes.key?(:'TopPadding')
    self.top_padding = attributes[:'TopPadding']
  end
end

Instance Attribute Details

#alignmentObject

Gets or sets the option that controls how an inline table is aligned in the document.



36
37
38
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 36

def alignment
  @alignment
end

#allow_auto_fitObject

Gets or sets a value indicating whether to automatically resize cells in a table to fit their contents.



39
40
41
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 39

def allow_auto_fit
  @allow_auto_fit
end

#bidiObject

Gets or sets a value indicating whether this is a right-to-left table.



42
43
44
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 42

def bidi
  @bidi
end

#bottom_paddingObject

Gets or sets the amount of space (in points) to add below the contents of cells.



45
46
47
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 45

def bottom_padding
  @bottom_padding
end

#cell_spacingObject

Gets or sets the amount of space (in points) between the cells.



48
49
50
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 48

def cell_spacing
  @cell_spacing
end

#left_indentObject

Gets or sets the value, that represents the left indent of the table.



51
52
53
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 51

def left_indent
  @left_indent
end

#left_paddingObject

Gets or sets the amount of space (in points) to add to the left of the contents of cells.



54
55
56
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 54

def left_padding
  @left_padding
end

Gets or sets the link to the document.



33
34
35
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 33

def link
  @link
end

#preferred_widthObject

Gets or sets the table preferred width. Preferred width can be specified as a percentage, number of points or a special “auto” value.



58
59
60
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 58

def preferred_width
  @preferred_width
end

#right_paddingObject

Gets or sets the amount of space (in points) to add to the right of the contents of cells.



61
62
63
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 61

def right_padding
  @right_padding
end

#style_identifierObject

Gets or sets the locale independent style identifier of the table style applied to this table.



64
65
66
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 64

def style_identifier
  @style_identifier
end

#style_nameObject

Gets or sets the name of the table style applied to this table.



67
68
69
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 67

def style_name
  @style_name
end

#style_optionsObject

Gets or sets the bit flags, that specify how a table style is applied to this table.



70
71
72
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 70

def style_options
  @style_options
end

#text_wrappingObject

Gets or sets the option that controls text wrapping for the table.



73
74
75
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 73

def text_wrapping
  @text_wrapping
end

#top_paddingObject

Gets or sets the amount of space (in points) to add above the contents of cells.



76
77
78
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 76

def top_padding
  @top_padding
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 101

def self.attribute_map
  {
    :'link' => :'Link',
    :'alignment' => :'Alignment',
    :'allow_auto_fit' => :'AllowAutoFit',
    :'bidi' => :'Bidi',
    :'bottom_padding' => :'BottomPadding',
    :'cell_spacing' => :'CellSpacing',
    :'left_indent' => :'LeftIndent',
    :'left_padding' => :'LeftPadding',
    :'preferred_width' => :'PreferredWidth',
    :'right_padding' => :'RightPadding',
    :'style_identifier' => :'StyleIdentifier',
    :'style_name' => :'StyleName',
    :'style_options' => :'StyleOptions',
    :'text_wrapping' => :'TextWrapping',
    :'top_padding' => :'TopPadding'
  }
end

.swagger_typesObject

Attribute type mapping.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 122

def self.swagger_types
  {
    :'link' => :'WordsApiLink',
    :'alignment' => :'String',
    :'allow_auto_fit' => :'BOOLEAN',
    :'bidi' => :'BOOLEAN',
    :'bottom_padding' => :'Float',
    :'cell_spacing' => :'Float',
    :'left_indent' => :'Float',
    :'left_padding' => :'Float',
    :'preferred_width' => :'PreferredWidth',
    :'right_padding' => :'Float',
    :'style_identifier' => :'String',
    :'style_name' => :'String',
    :'style_options' => :'String',
    :'text_wrapping' => :'String',
    :'top_padding' => :'Float'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 292

def ==(other)
  return true if self.equal?(other)
  self.class == other.class &&
      link == other.link &&
      alignment == other.alignment &&
      allow_auto_fit == other.allow_auto_fit &&
      bidi == other.bidi &&
      bottom_padding == other.bottom_padding &&
      cell_spacing == other.cell_spacing &&
      left_indent == other.left_indent &&
      left_padding == other.left_padding &&
      preferred_width == other.preferred_width &&
      right_padding == other.right_padding &&
      style_identifier == other.style_identifier &&
      style_name == other.style_name &&
      style_options == other.style_options &&
      text_wrapping == other.text_wrapping &&
      top_padding == other.top_padding
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 349

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    Time.at(/\d/.match(value)[0].to_f).to_datetime
  when :Date
    Time.at(/\d/.match(value)[0].to_f).to_date
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else
  # model
    temp_model = AsposeWordsCloud.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



416
417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 416

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 327

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


314
315
316
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 314

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



320
321
322
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 320

def hash
  [link, alignment, allow_auto_fit, bidi, bottom_padding, cell_spacing, left_indent, left_padding, preferred_width, right_padding, style_identifier, style_name, style_options, text_wrapping, top_padding].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



213
214
215
216
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 213

def list_invalid_properties
  invalid_properties = []
  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



396
397
398
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 396

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



402
403
404
405
406
407
408
409
410
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 402

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



390
391
392
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 390

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/aspose_words_cloud/models/table_properties.rb', line 220

def valid?
  alignment_validator = EnumAttributeValidator.new('String', ["Left", "Center", "Right"])
  return false unless alignment_validator.valid?(@alignment)
  style_identifier_validator = EnumAttributeValidator.new('String', ["Normal", "Heading1", "Heading2", "Heading3", "Heading4", "Heading5", "Heading6", "Heading7", "Heading8", "Heading9", "Index1", "Index2", "Index3", "Index4", "Index5", "Index6", "Index7", "Index8", "Index9", "Toc1", "Toc2", "Toc3", "Toc4", "Toc5", "Toc6", "Toc7", "Toc8", "Toc9", "NormalIndent", "FootnoteText", "CommentText", "Header", "Footer", "IndexHeading", "Caption", "TableOfFigures", "EnvelopeAddress", "EnvelopeReturn", "FootnoteReference", "CommentReference", "LineNumber", "PageNumber", "EndnoteReference", "EndnoteText", "TableOfAuthorities", "Macro", "ToaHeading", "List", "ListBullet", "ListNumber", "List2", "List3", "List4", "List5", "ListBullet2", "ListBullet3", "ListBullet4", "ListBullet5", "ListNumber2", "ListNumber3", "ListNumber4", "ListNumber5", "Title", "Closing", "Signature", "DefaultParagraphFont", "BodyText", "BodyTextInd", "ListContinue", "ListContinue2", "ListContinue3", "ListContinue4", "ListContinue5", "MessageHeader", "Subtitle", "Salutation", "Date", "BodyText1I", "BodyText1I2", "NoteHeading", "BodyText2", "BodyText3", "BodyTextInd2", "BodyTextInd3", "BlockText", "Hyperlink", "FollowedHyperlink", "Strong", "Emphasis", "DocumentMap", "PlainText", "EmailSignature", "HtmlTopOfForm", "HtmlBottomOfForm", "NormalWeb", "HtmlAcronym", "HtmlAddress", "HtmlCite", "HtmlCode", "HtmlDefinition", "HtmlKeyboard", "HtmlPreformatted", "HtmlSample", "HtmlTypewriter", "HtmlVariable", "TableNormal", "CommentSubject", "NoList", "OutlineList1", "OutlineList2", "OutlineList3", "TableSimple1", "TableSimple2", "TableSimple3", "TableClassic1", "TableClassic2", "TableClassic3", "TableClassic4", "TableColorful1", "TableColorful2", "TableColorful3", "TableColumns1", "TableColumns2", "TableColumns3", "TableColumns4", "TableColumns5", "TableGrid1", "TableGrid2", "TableGrid3", "TableGrid4", "TableGrid5", "TableGrid6", "TableGrid7", "TableGrid8", "TableList1", "TableList2", "TableList3", "TableList4", "TableList5", "TableList6", "TableList7", "TableList8", "Table3DEffects1", "Table3DEffects2", "Table3DEffects3", "TableContemporary", "TableElegant", "TableProfessional", "TableSubtle1", "TableSubtle2", "TableWeb1", "TableWeb2", "TableWeb3", "BalloonText", "TableGrid", "TableTheme", "PlaceholderText", "NoSpacing", "LightShading", "LightList", "LightGrid", "MediumShading1", "MediumShading2", "MediumList1", "MediumList2", "MediumGrid1", "MediumGrid2", "MediumGrid3", "DarkList", "ColorfulShading", "ColorfulList", "ColorfulGrid", "LightShadingAccent1", "LightListAccent1", "LightGridAccent1", "MediumShading1Accent1", "MediumShading2Accent1", "MediumList1Accent1", "Revision", "ListParagraph", "Quote", "IntenseQuote", "MediumList2Accent1", "MediumGrid1Accent1", "MediumGrid2Accent1", "MediumGrid3Accent1", "DarkListAccent1", "ColorfulShadingAccent1", "ColorfulListAccent1", "ColorfulGridAccent1", "LightShadingAccent2", "LightListAccent2", "LightGridAccent2", "MediumShading1Accent2", "MediumShading2Accent2", "MediumList1Accent2", "MediumList2Accent2", "MediumGrid1Accent2", "MediumGrid2Accent2", "MediumGrid3Accent2", "DarkListAccent2", "ColorfulShadingAccent2", "ColorfulListAccent2", "ColorfulGridAccent2", "LightShadingAccent3", "LightListAccent3", "LightGridAccent3", "MediumShading1Accent3", "MediumShading2Accent3", "MediumList1Accent3", "MediumList2Accent3", "MediumGrid1Accent3", "MediumGrid2Accent3", "MediumGrid3Accent3", "DarkListAccent3", "ColorfulShadingAccent3", "ColorfulListAccent3", "ColorfulGridAccent3", "LightShadingAccent4", "LightListAccent4", "LightGridAccent4", "MediumShading1Accent4", "MediumShading2Accent4", "MediumList1Accent4", "MediumList2Accent4", "MediumGrid1Accent4", "MediumGrid2Accent4", "MediumGrid3Accent4", "DarkListAccent4", "ColorfulShadingAccent4", "ColorfulListAccent4", "ColorfulGridAccent4", "LightShadingAccent5", "LightListAccent5", "LightGridAccent5", "MediumShading1Accent5", "MediumShading2Accent5", "MediumList1Accent5", "MediumList2Accent5", "MediumGrid1Accent5", "MediumGrid2Accent5", "MediumGrid3Accent5", "DarkListAccent5", "ColorfulShadingAccent5", "ColorfulListAccent5", "ColorfulGridAccent5", "LightShadingAccent6", "LightListAccent6", "LightGridAccent6", "MediumShading1Accent6", "MediumShading2Accent6", "MediumList1Accent6", "MediumList2Accent6", "MediumGrid1Accent6", "MediumGrid2Accent6", "MediumGrid3Accent6", "DarkListAccent6", "ColorfulShadingAccent6", "ColorfulListAccent6", "ColorfulGridAccent6", "SubtleEmphasis", "IntenseEmphasis", "SubtleReference", "IntenseReference", "BookTitle", "Bibliography", "TocHeading", "PlainTable1", "PlainTable2", "PlainTable3", "PlainTable4", "PlainTable5", "TableGridLight", "GridTable1Light", "GridTable2", "GridTable3", "GridTable4", "GridTable5Dark", "GridTable6Colorful", "GridTable7Colorful", "GridTable1LightAccent1", "GridTable2Accent1", "GridTable3Accent1", "GridTable4Accent1", "GridTable5DarkAccent1", "GridTable6ColorfulAccent1", "GridTable7ColorfulAccent1", "GridTable1LightAccent2", "GridTable2Accent2", "GridTable3Accent2", "GridTable4Accent2", "GridTable5DarkAccent2", "GridTable6ColorfulAccent2", "GridTable7ColorfulAccent2", "GridTable1LightAccent3", "GridTable2Accent3", "GridTable3Accent3", "GridTable4Accent3", "GridTable5DarkAccent3", "GridTable6ColorfulAccent3", "GridTable7ColorfulAccent3", "GridTable1LightAccent4", "GridTable2Accent4", "GridTable3Accent4", "GridTable4Accent4", "GridTable5DarkAccent4", "GridTable6ColorfulAccent4", "GridTable7ColorfulAccent4", "GridTable1LightAccent5", "GridTable2Accent5", "GridTable3Accent5", "GridTable4Accent5", "GridTable5DarkAccent5", "GridTable6ColorfulAccent5", "GridTable7ColorfulAccent5", "GridTable1LightAccent6", "GridTable2Accent6", "GridTable3Accent6", "GridTable4Accent6", "GridTable5DarkAccent6", "GridTable6ColorfulAccent6", "GridTable7ColorfulAccent6", "ListTable1Light", "ListTable2", "ListTable3", "ListTable4", "ListTable5Dark", "ListTable6Colorful", "ListTable7Colorful", "ListTable1LightAccent1", "ListTable2Accent1", "ListTable3Accent1", "ListTable4Accent1", "ListTable5DarkAccent1", "ListTable6ColorfulAccent1", "ListTable7ColorfulAccent1", "ListTable1LightAccent2", "ListTable2Accent2", "ListTable3Accent2", "ListTable4Accent2", "ListTable5DarkAccent2", "ListTable6ColorfulAccent2", "ListTable7ColorfulAccent2", "ListTable1LightAccent3", "ListTable2Accent3", "ListTable3Accent3", "ListTable4Accent3", "ListTable5DarkAccent3", "ListTable6ColorfulAccent3", "ListTable7ColorfulAccent3", "ListTable1LightAccent4", "ListTable2Accent4", "ListTable3Accent4", "ListTable4Accent4", "ListTable5DarkAccent4", "ListTable6ColorfulAccent4", "ListTable7ColorfulAccent4", "ListTable1LightAccent5", "ListTable2Accent5", "ListTable3Accent5", "ListTable4Accent5", "ListTable5DarkAccent5", "ListTable6ColorfulAccent5", "ListTable7ColorfulAccent5", "ListTable1LightAccent6", "ListTable2Accent6", "ListTable3Accent6", "ListTable4Accent6", "ListTable5DarkAccent6", "ListTable6ColorfulAccent6", "ListTable7ColorfulAccent6", "SmartLink", "Mention", "SmartHyperlink", "Hashtag", "UnresolvedMention", "User", "Nil"])
  return false unless style_identifier_validator.valid?(@style_identifier)
  style_options_validator = EnumAttributeValidator.new('String', ["None", "FirstRow", "LastRow", "FirstColumn", "LastColumn", "RowBands", "Default", "ColumnBands", "Default2003"])
  return false unless style_options_validator.valid?(@style_options)
  text_wrapping_validator = EnumAttributeValidator.new('String', ["Default", "None", "Around"])
  return false unless text_wrapping_validator.valid?(@text_wrapping)

  return true
end