Class: AsposeSlidesCloud::ParagraphFormat

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

Overview

Paragraph formatting properties.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ParagraphFormat

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
258
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 169

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

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

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

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

  if attributes.has_key?(:'RightToLeft')
    self.right_to_left = attributes[:'RightToLeft']
  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?(:'HangingPunctuation')
    self.hanging_punctuation = attributes[:'HangingPunctuation']
  end

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

  if attributes.has_key?(:'DefaultPortionFormat')
    self.default_portion_format = attributes[:'DefaultPortionFormat']
  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?(:'BulletFillFormat')
    self.bullet_fill_format = attributes[:'BulletFillFormat']
  end
end

Instance Attribute Details

#alignmentObject

Text alignment.



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

def alignment
  @alignment
end

#bullet_charObject

Bullet char.



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

def bullet_char
  @bullet_char
end

#bullet_fill_formatObject

Bullet fill format.



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

def bullet_fill_format
  @bullet_fill_format
end

#bullet_heightObject

Bullet height.



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

def bullet_height
  @bullet_height
end

#bullet_typeObject

Bullet type.



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

def bullet_type
  @bullet_type
end

#default_portion_formatObject

Default portion format.



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

def default_portion_format
  @default_portion_format
end

#default_tab_sizeObject

Returns or sets default tabulation size with no inheritance.



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

def default_tab_size
  @default_tab_size
end

#depthObject

Depth.



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

def depth
  @depth
end

#east_asian_line_breakObject

Determines whether the East Asian line break is used in a paragraph. No inheritance applied.



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

def east_asian_line_break
  @east_asian_line_break
end

#font_alignmentObject

Font alignment.



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

def font_alignment
  @font_alignment
end

#hanging_punctuationObject

Determines whether the hanging punctuation is used in a paragraph. No inheritance applied.



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

def hanging_punctuation
  @hanging_punctuation
end

#indentObject

First line indent.



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

def indent
  @indent
end

#latin_line_breakObject

Determines whether the Latin line break is used in a paragraph. No inheritance applied.



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

def latin_line_break
  @latin_line_break
end

#margin_leftObject

Left margin.



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

def margin_left
  @margin_left
end

#margin_rightObject

Right margin.



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

def margin_right
  @margin_right
end

#numbered_bullet_start_withObject

Starting number for a numbered bullet.



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

def numbered_bullet_start_with
  @numbered_bullet_start_with
end

#numbered_bullet_styleObject

Numbered bullet style.



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

def numbered_bullet_style
  @numbered_bullet_style
end

#right_to_leftObject

Determines whether the Right to Left writing is used in a paragraph. No inheritance applied.



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

def right_to_left
  @right_to_left
end

#space_afterObject

Right spacing.



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

def space_after
  @space_after
end

#space_beforeObject

Left spacing.



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

def space_before
  @space_before
end

#space_withinObject

Spacing between lines.



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

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_format.rb', line 114

def self.attribute_map
  {
    :'depth' => :'Depth',
    :'alignment' => :'Alignment',
    :'margin_left' => :'MarginLeft',
    :'margin_right' => :'MarginRight',
    :'space_before' => :'SpaceBefore',
    :'space_after' => :'SpaceAfter',
    :'space_within' => :'SpaceWithin',
    :'font_alignment' => :'FontAlignment',
    :'indent' => :'Indent',
    :'right_to_left' => :'RightToLeft',
    :'east_asian_line_break' => :'EastAsianLineBreak',
    :'latin_line_break' => :'LatinLineBreak',
    :'hanging_punctuation' => :'HangingPunctuation',
    :'default_tab_size' => :'DefaultTabSize',
    :'default_portion_format' => :'DefaultPortionFormat',
    :'bullet_char' => :'BulletChar',
    :'bullet_height' => :'BulletHeight',
    :'bullet_type' => :'BulletType',
    :'numbered_bullet_start_with' => :'NumberedBulletStartWith',
    :'numbered_bullet_style' => :'NumberedBulletStyle',
    :'bullet_fill_format' => :'BulletFillFormat',
  }
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_format.rb', line 141

def self.swagger_types
  {
    :'depth' => :'Integer',
    :'alignment' => :'String',
    :'margin_left' => :'Float',
    :'margin_right' => :'Float',
    :'space_before' => :'Float',
    :'space_after' => :'Float',
    :'space_within' => :'Float',
    :'font_alignment' => :'String',
    :'indent' => :'Float',
    :'right_to_left' => :'String',
    :'east_asian_line_break' => :'String',
    :'latin_line_break' => :'String',
    :'hanging_punctuation' => :'String',
    :'default_tab_size' => :'Float',
    :'default_portion_format' => :'PortionFormat',
    :'bullet_char' => :'String',
    :'bullet_height' => :'Float',
    :'bullet_type' => :'String',
    :'numbered_bullet_start_with' => :'Integer',
    :'numbered_bullet_style' => :'String',
    :'bullet_fill_format' => :'FillFormat',
  }
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
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 371

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      depth == o.depth &&
      alignment == o.alignment &&
      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 &&
      font_alignment == o.font_alignment &&
      indent == o.indent &&
      right_to_left == o.right_to_left &&
      east_asian_line_break == o.east_asian_line_break &&
      latin_line_break == o.latin_line_break &&
      hanging_punctuation == o.hanging_punctuation &&
      default_tab_size == o.default_tab_size &&
      default_portion_format == o.default_portion_format &&
      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 &&
      bullet_fill_format == o.bullet_fill_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



445
446
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
488
489
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 445

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



519
520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 519

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



412
413
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
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 412

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


399
400
401
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 399

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



405
406
407
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 405

def hash
  [depth, alignment, margin_left, margin_right, space_before, space_after, space_within, font_alignment, indent, right_to_left, east_asian_line_break, latin_line_break, hanging_punctuation, default_tab_size, default_portion_format, bullet_char, bullet_height, bullet_type, numbered_bullet_start_with, numbered_bullet_style, bullet_fill_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



262
263
264
265
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 262

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



499
500
501
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 499

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



505
506
507
508
509
510
511
512
513
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 505

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



493
494
495
# File 'lib/aspose_slides_cloud/models/paragraph_format.rb', line 493

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



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_format.rb', line 269

def valid?
  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)
  right_to_left_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless right_to_left_validator.valid?(@right_to_left)
  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)
  hanging_punctuation_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless hanging_punctuation_validator.valid?(@hanging_punctuation)
  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)
  true
end