Class: AsposeSlidesCloud::Paragraph

Inherits:
ResourceBase show all
Defined in:
lib/aspose_slides_cloud/models/paragraph.rb

Overview

Represents paragraph resource

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Attributes inherited from ResourceBase

#alternate_links, #self_uri

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Paragraph

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
250
251
252
253
254
255
256
257
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 169

def initialize(attributes = {})
  super

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

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

  if attributes.has_key?(:'SpaceBefore')
    self.space_before = attributes[:'SpaceBefore']
  end

  if attributes.has_key?(:'SpaceAfter')
    self.space_after = attributes[:'SpaceAfter']
  end

  if attributes.has_key?(:'SpaceWithin')
    self.space_within = attributes[:'SpaceWithin']
  end

  if attributes.has_key?(:'Indent')
    self.indent = attributes[:'Indent']
  end

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

  if attributes.has_key?(:'FontAlignment')
    self.font_alignment = attributes[:'FontAlignment']
  end

  if attributes.has_key?(:'DefaultTabSize')
    self.default_tab_size = attributes[:'DefaultTabSize']
  end

  if attributes.has_key?(:'Depth')
    self.depth = attributes[:'Depth']
  end

  if attributes.has_key?(:'BulletChar')
    self.bullet_char = attributes[:'BulletChar']
  end

  if attributes.has_key?(:'BulletHeight')
    self.bullet_height = attributes[:'BulletHeight']
  end

  if attributes.has_key?(:'BulletType')
    self.bullet_type = attributes[:'BulletType']
  end

  if attributes.has_key?(:'NumberedBulletStartWith')
    self.numbered_bullet_start_with = attributes[:'NumberedBulletStartWith']
  end

  if attributes.has_key?(:'NumberedBulletStyle')
    self.numbered_bullet_style = attributes[:'NumberedBulletStyle']
  end

  if attributes.has_key?(:'HangingPunctuation')
    self.hanging_punctuation = attributes[:'HangingPunctuation']
  end

  if attributes.has_key?(:'EastAsianLineBreak')
    self.east_asian_line_break = attributes[:'EastAsianLineBreak']
  end

  if attributes.has_key?(:'LatinLineBreak')
    self.latin_line_break = attributes[:'LatinLineBreak']
  end

  if attributes.has_key?(:'RightToLeft')
    self.right_to_left = attributes[:'RightToLeft']
  end

  if attributes.has_key?(:'PortionList')
    if (value = attributes[:'PortionList']).is_a?(Array)
      self.portion_list = value
    end
  end

  if attributes.has_key?(:'DefaultPortionFormat')
    self.default_portion_format = attributes[:'DefaultPortionFormat']
  end
end

Instance Attribute Details

#alignmentObject

Text alignment.



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

def alignment
  @alignment
end

#bullet_charObject

Bullet char.



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

def bullet_char
  @bullet_char
end

#bullet_heightObject

Bullet height.



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

def bullet_height
  @bullet_height
end

#bullet_typeObject

Bullet type.



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

def bullet_type
  @bullet_type
end

#default_portion_formatObject

Default portion format.



89
90
91
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 89

def default_portion_format
  @default_portion_format
end

#default_tab_sizeObject

Default tabulation size.



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

def default_tab_size
  @default_tab_size
end

#depthObject

Depth.



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

def depth
  @depth
end

#east_asian_line_breakObject

True if East Asian line break is used with the paragraph.



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

def east_asian_line_break
  @east_asian_line_break
end

#font_alignmentObject

Font alignment.



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

def font_alignment
  @font_alignment
end

#hanging_punctuationObject

True if hanging punctuation is used with the paragraph.



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

def hanging_punctuation
  @hanging_punctuation
end

#indentObject

First line indent.



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

def indent
  @indent
end

#latin_line_breakObject

True if Latin line break is used with the paragraph.



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

def latin_line_break
  @latin_line_break
end

#margin_leftObject

Left margin.



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

def margin_left
  @margin_left
end

#margin_rightObject

Right margin.



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

def margin_right
  @margin_right
end

#numbered_bullet_start_withObject

Starting number for a numbered bullet.



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

def numbered_bullet_start_with
  @numbered_bullet_start_with
end

#numbered_bullet_styleObject

Numbered bullet style.



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

def numbered_bullet_style
  @numbered_bullet_style
end

#portion_listObject

List of portion links.



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

def portion_list
  @portion_list
end

#right_to_leftObject

True if right to left direction is used with the paragraph.



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

def right_to_left
  @right_to_left
end

#space_afterObject

Right spacing.



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

def space_after
  @space_after
end

#space_beforeObject

Left spacing.



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

def space_before
  @space_before
end

#space_withinObject

Spacing between lines.



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

def space_within
  @space_within
end

Class Method Details

.attribute_mapObject

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



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 114

def self.attribute_map
  super.merge({
    :'margin_left' => :'MarginLeft',
    :'margin_right' => :'MarginRight',
    :'space_before' => :'SpaceBefore',
    :'space_after' => :'SpaceAfter',
    :'space_within' => :'SpaceWithin',
    :'indent' => :'Indent',
    :'alignment' => :'Alignment',
    :'font_alignment' => :'FontAlignment',
    :'default_tab_size' => :'DefaultTabSize',
    :'depth' => :'Depth',
    :'bullet_char' => :'BulletChar',
    :'bullet_height' => :'BulletHeight',
    :'bullet_type' => :'BulletType',
    :'numbered_bullet_start_with' => :'NumberedBulletStartWith',
    :'numbered_bullet_style' => :'NumberedBulletStyle',
    :'hanging_punctuation' => :'HangingPunctuation',
    :'east_asian_line_break' => :'EastAsianLineBreak',
    :'latin_line_break' => :'LatinLineBreak',
    :'right_to_left' => :'RightToLeft',
    :'portion_list' => :'PortionList',
    :'default_portion_format' => :'DefaultPortionFormat',
  })
end

.swagger_typesObject

Attribute type mapping.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 141

def self.swagger_types
  super.merge({
    :'margin_left' => :'Float',
    :'margin_right' => :'Float',
    :'space_before' => :'Float',
    :'space_after' => :'Float',
    :'space_within' => :'Float',
    :'indent' => :'Float',
    :'alignment' => :'String',
    :'font_alignment' => :'String',
    :'default_tab_size' => :'Float',
    :'depth' => :'Integer',
    :'bullet_char' => :'String',
    :'bullet_height' => :'Float',
    :'bullet_type' => :'String',
    :'numbered_bullet_start_with' => :'Integer',
    :'numbered_bullet_style' => :'String',
    :'hanging_punctuation' => :'String',
    :'east_asian_line_break' => :'String',
    :'latin_line_break' => :'String',
    :'right_to_left' => :'String',
    :'portion_list' => :'Array<Portion>',
    :'default_portion_format' => :'PortionFormat',
  })
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 371

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      self_uri == o.self_uri &&
      alternate_links == o.alternate_links &&
      margin_left == o.margin_left &&
      margin_right == o.margin_right &&
      space_before == o.space_before &&
      space_after == o.space_after &&
      space_within == o.space_within &&
      indent == o.indent &&
      alignment == o.alignment &&
      font_alignment == o.font_alignment &&
      default_tab_size == o.default_tab_size &&
      depth == o.depth &&
      bullet_char == o.bullet_char &&
      bullet_height == o.bullet_height &&
      bullet_type == o.bullet_type &&
      numbered_bullet_start_with == o.numbered_bullet_start_with &&
      numbered_bullet_style == o.numbered_bullet_style &&
      hanging_punctuation == o.hanging_punctuation &&
      east_asian_line_break == o.east_asian_line_break &&
      latin_line_break == o.latin_line_break &&
      right_to_left == o.right_to_left &&
      portion_list == o.portion_list &&
      default_portion_format == o.default_portion_format
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



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 447

def _deserialize(type, value)
  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

#_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



517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 517

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



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 414

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


401
402
403
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 401

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



407
408
409
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 407

def hash
  [self_uri, alternate_links, margin_left, margin_right, space_before, space_after, space_within, indent, alignment, font_alignment, default_tab_size, depth, bullet_char, bullet_height, bullet_type, numbered_bullet_start_with, numbered_bullet_style, hanging_punctuation, east_asian_line_break, latin_line_break, right_to_left, portion_list, default_portion_format].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



261
262
263
264
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 261

def list_invalid_properties
  invalid_properties = super
  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



497
498
499
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 497

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



503
504
505
506
507
508
509
510
511
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 503

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



491
492
493
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 491

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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/aspose_slides_cloud/models/paragraph.rb', line 268

def valid?
  return false if !super
  alignment_validator = EnumAttributeValidator.new('String', ['Left', 'Center', 'Right', 'Justify', 'JustifyLow', 'Distributed', 'NotDefined'])
  return false unless alignment_validator.valid?(@alignment)
  font_alignment_validator = EnumAttributeValidator.new('String', ['Automatic', 'Top', 'Center', 'Bottom', 'Baseline', 'Default'])
  return false unless font_alignment_validator.valid?(@font_alignment)
  bullet_type_validator = EnumAttributeValidator.new('String', ['None', 'Symbol', 'Numbered', 'Picture', 'NotDefined'])
  return false unless bullet_type_validator.valid?(@bullet_type)
  numbered_bullet_style_validator = EnumAttributeValidator.new('String', ['BulletAlphaLCPeriod', 'BulletAlphaUCPeriod', 'BulletArabicParenRight', 'BulletArabicPeriod', 'BulletRomanLCParenBoth', 'BulletRomanLCParenRight', 'BulletRomanLCPeriod', 'BulletRomanUCPeriod', 'BulletAlphaLCParenBoth', 'BulletAlphaLCParenRight', 'BulletAlphaUCParenBoth', 'BulletAlphaUCParenRight', 'BulletArabicParenBoth', 'BulletArabicPlain', 'BulletRomanUCParenBoth', 'BulletRomanUCParenRight', 'BulletSimpChinPlain', 'BulletSimpChinPeriod', 'BulletCircleNumDBPlain', 'BulletCircleNumWDWhitePlain', 'BulletCircleNumWDBlackPlain', 'BulletTradChinPlain', 'BulletTradChinPeriod', 'BulletArabicAlphaDash', 'BulletArabicAbjadDash', 'BulletHebrewAlphaDash', 'BulletKanjiKoreanPlain', 'BulletKanjiKoreanPeriod', 'BulletArabicDBPlain', 'BulletArabicDBPeriod', 'BulletThaiAlphaPeriod', 'BulletThaiAlphaParenRight', 'BulletThaiAlphaParenBoth', 'BulletThaiNumPeriod', 'BulletThaiNumParenRight', 'BulletThaiNumParenBoth', 'BulletHindiAlphaPeriod', 'BulletHindiNumPeriod', 'BulletKanjiSimpChinDBPeriod', 'BulletHindiNumParenRight', 'BulletHindiAlpha1Period', 'NotDefined'])
  return false unless numbered_bullet_style_validator.valid?(@numbered_bullet_style)
  hanging_punctuation_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless hanging_punctuation_validator.valid?(@hanging_punctuation)
  east_asian_line_break_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless east_asian_line_break_validator.valid?(@east_asian_line_break)
  latin_line_break_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless latin_line_break_validator.valid?(@latin_line_break)
  right_to_left_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless right_to_left_validator.valid?(@right_to_left)
  true
end