Class: AsposeSlidesCloud::TableCell

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_slides_cloud/models/table_cell.rb

Overview

Represents one cell of table.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TableCell

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 164

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.has_key?(:'Text')
    self.text = attributes[:'Text']
  end

  if attributes.has_key?(:'RowSpan')
    self.row_span = attributes[:'RowSpan']
  end

  if attributes.has_key?(:'ColSpan')
    self.col_span = attributes[:'ColSpan']
  end

  if attributes.has_key?(:'MarginTop')
    self.margin_top = attributes[:'MarginTop']
  end

  if attributes.has_key?(:'MarginRight')
    self.margin_right = attributes[:'MarginRight']
  end

  if attributes.has_key?(:'MarginLeft')
    self.margin_left = attributes[:'MarginLeft']
  end

  if attributes.has_key?(:'MarginBottom')
    self.margin_bottom = attributes[:'MarginBottom']
  end

  if attributes.has_key?(:'TextAnchorType')
    self.text_anchor_type = attributes[:'TextAnchorType']
  end

  if attributes.has_key?(:'TextVerticalType')
    self.text_vertical_type = attributes[:'TextVerticalType']
  end

  if attributes.has_key?(:'FillFormat')
    self.fill_format = attributes[:'FillFormat']
  end

  if attributes.has_key?(:'BorderTop')
    self.border_top = attributes[:'BorderTop']
  end

  if attributes.has_key?(:'BorderRight')
    self.border_right = attributes[:'BorderRight']
  end

  if attributes.has_key?(:'BorderLeft')
    self.border_left = attributes[:'BorderLeft']
  end

  if attributes.has_key?(:'BorderBottom')
    self.border_bottom = attributes[:'BorderBottom']
  end

  if attributes.has_key?(:'BorderDiagonalUp')
    self.border_diagonal_up = attributes[:'BorderDiagonalUp']
  end

  if attributes.has_key?(:'BorderDiagonalDown')
    self.border_diagonal_down = attributes[:'BorderDiagonalDown']
  end

  if attributes.has_key?(:'ColumnIndex')
    self.column_index = attributes[:'ColumnIndex']
  end

  if attributes.has_key?(:'RowIndex')
    self.row_index = attributes[:'RowIndex']
  end

  if attributes.has_key?(:'TextFrameFormat')
    self.text_frame_format = attributes[:'TextFrameFormat']
  end

  if attributes.has_key?(:'Paragraphs')
    self.paragraphs = attributes[:'Paragraphs']
  end
end

Instance Attribute Details

#border_bottomObject

Line properties set for the bottom border of the cell.



68
69
70
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 68

def border_bottom
  @border_bottom
end

#border_diagonal_downObject

Line properties set for the diagonal down border of the cell.



74
75
76
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 74

def border_diagonal_down
  @border_diagonal_down
end

#border_diagonal_upObject

Line properties set for the diagonal up border of the cell.



71
72
73
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 71

def border_diagonal_up
  @border_diagonal_up
end

#border_leftObject

Line properties set for the left border of the cell.



65
66
67
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 65

def border_left
  @border_left
end

#border_rightObject

Line properties set for the right border of the cell.



62
63
64
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 62

def border_right
  @border_right
end

#border_topObject

Line properties set for the top border of the cell.



59
60
61
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 59

def border_top
  @border_top
end

#col_spanObject

The number of columns spanned by a merged cell.



35
36
37
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 35

def col_span
  @col_span
end

#column_indexObject

Cell column index



77
78
79
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 77

def column_index
  @column_index
end

#fill_formatObject

Fill properties set of the cell.



56
57
58
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 56

def fill_format
  @fill_format
end

#margin_bottomObject

The bottom margin of the cell.



47
48
49
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 47

def margin_bottom
  @margin_bottom
end

#margin_leftObject

The left margin of the cell.



44
45
46
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 44

def margin_left
  @margin_left
end

#margin_rightObject

The right margin of the cell.



41
42
43
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 41

def margin_right
  @margin_right
end

#margin_topObject

The top margin of the cell.



38
39
40
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 38

def margin_top
  @margin_top
end

#paragraphsObject

Get or sets list to paragraphs list



86
87
88
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 86

def paragraphs
  @paragraphs
end

#row_indexObject

Cell row index



80
81
82
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 80

def row_index
  @row_index
end

#row_spanObject

The number of rows spanned by a merged cell.



32
33
34
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 32

def row_span
  @row_span
end

#textObject

Cell text.



29
30
31
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 29

def text
  @text
end

#text_anchor_typeObject

Text anchor type.



50
51
52
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 50

def text_anchor_type
  @text_anchor_type
end

#text_frame_formatObject

Returns TextFrame’s formatting properties.



83
84
85
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 83

def text_frame_format
  @text_frame_format
end

#text_vertical_typeObject

The type of vertical text.



53
54
55
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 53

def text_vertical_type
  @text_vertical_type
end

Class Method Details

.attribute_mapObject

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



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 111

def self.attribute_map
  {
    :'text' => :'Text',
    :'row_span' => :'RowSpan',
    :'col_span' => :'ColSpan',
    :'margin_top' => :'MarginTop',
    :'margin_right' => :'MarginRight',
    :'margin_left' => :'MarginLeft',
    :'margin_bottom' => :'MarginBottom',
    :'text_anchor_type' => :'TextAnchorType',
    :'text_vertical_type' => :'TextVerticalType',
    :'fill_format' => :'FillFormat',
    :'border_top' => :'BorderTop',
    :'border_right' => :'BorderRight',
    :'border_left' => :'BorderLeft',
    :'border_bottom' => :'BorderBottom',
    :'border_diagonal_up' => :'BorderDiagonalUp',
    :'border_diagonal_down' => :'BorderDiagonalDown',
    :'column_index' => :'ColumnIndex',
    :'row_index' => :'RowIndex',
    :'text_frame_format' => :'TextFrameFormat',
    :'paragraphs' => :'Paragraphs',
  }
end

.swagger_typesObject

Attribute type mapping.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 137

def self.swagger_types
  {
    :'text' => :'String',
    :'row_span' => :'Integer',
    :'col_span' => :'Integer',
    :'margin_top' => :'Float',
    :'margin_right' => :'Float',
    :'margin_left' => :'Float',
    :'margin_bottom' => :'Float',
    :'text_anchor_type' => :'String',
    :'text_vertical_type' => :'String',
    :'fill_format' => :'FillFormat',
    :'border_top' => :'LineFormat',
    :'border_right' => :'LineFormat',
    :'border_left' => :'LineFormat',
    :'border_bottom' => :'LineFormat',
    :'border_diagonal_up' => :'LineFormat',
    :'border_diagonal_down' => :'LineFormat',
    :'column_index' => :'Integer',
    :'row_index' => :'Integer',
    :'text_frame_format' => :'TextFrameFormat',
    :'paragraphs' => :'ResourceUri',
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 290

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      text == o.text &&
      row_span == o.row_span &&
      col_span == o.col_span &&
      margin_top == o.margin_top &&
      margin_right == o.margin_right &&
      margin_left == o.margin_left &&
      margin_bottom == o.margin_bottom &&
      text_anchor_type == o.text_anchor_type &&
      text_vertical_type == o.text_vertical_type &&
      fill_format == o.fill_format &&
      border_top == o.border_top &&
      border_right == o.border_right &&
      border_left == o.border_left &&
      border_bottom == o.border_bottom &&
      border_diagonal_up == o.border_diagonal_up &&
      border_diagonal_down == o.border_diagonal_down &&
      column_index == o.column_index &&
      row_index == o.row_index &&
      text_frame_format == o.text_frame_format &&
      paragraphs == o.paragraphs
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



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 363

def _deserialize(type, value)
  if value.nil?
    nil
  else
    case type.to_sym
    when :DateTime
      DateTime.parse(value)
    when :Date
      Date.parse(value)
    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
      registry_type = AsposeSlidesCloud::TypeRegistry.get_type(type.to_s, value)
      if registry_type
        type = registry_type
      end
      temp_model = AsposeSlidesCloud.const_get(type).new
      temp_model.build_from_hash(value)
    end
  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



437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 437

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



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 330

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    mapKey = self.class.attribute_map[key]
    if !mapKey.nil?
      val = attributes[mapKey]
      if val.nil?
        mapKeyString = mapKey.to_s
        mapKeyString[0] = mapKeyString[0].downcase
        mapKey = mapKeyString.to_sym
        val = attributes[mapKey]
      end
      if !val.nil?
        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 val.is_a?(Array)
            self.send("#{key}=", val.map { |v| _deserialize($1, v) })
          end
        else
          self.send("#{key}=", _deserialize(type, val))
        end
      end
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


317
318
319
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 317

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



323
324
325
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 323

def hash
  [text, row_span, col_span, margin_top, margin_right, margin_left, margin_bottom, text_anchor_type, text_vertical_type, fill_format, border_top, border_right, border_left, border_bottom, border_diagonal_up, border_diagonal_down, column_index, row_index, text_frame_format, paragraphs].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



253
254
255
256
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 253

def list_invalid_properties
  invalid_properties = Array.new
  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



417
418
419
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 417

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



423
424
425
426
427
428
429
430
431
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 423

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



411
412
413
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 411

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



260
261
262
263
264
265
266
# File 'lib/aspose_slides_cloud/models/table_cell.rb', line 260

def valid?
  text_anchor_type_validator = EnumAttributeValidator.new('String', ['Top', 'Center', 'Bottom', 'Justified', 'Distributed', 'NotDefined'])
  return false unless text_anchor_type_validator.valid?(@text_anchor_type)
  text_vertical_type_validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical', 'Vertical270', 'WordArtVertical', 'EastAsianVertical', 'MongolianVertical', 'WordArtVerticalRightToLeft', 'NotDefined'])
  return false unless text_vertical_type_validator.valid?(@text_vertical_type)
  true
end