Class: AsposeSlidesCloud::Portion

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

Overview

Represents portion 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 = {}) ⇒ Portion

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/aspose_slides_cloud/models/portion.rb', line 189

def initialize(attributes = {})
  super

  if attributes.has_key?(:'Text')
    self.text = attributes[:'Text']
  end

  if attributes.has_key?(:'FontBold')
    self.font_bold = attributes[:'FontBold']
  end

  if attributes.has_key?(:'FontItalic')
    self.font_italic = attributes[:'FontItalic']
  end

  if attributes.has_key?(:'FontUnderline')
    self.font_underline = attributes[:'FontUnderline']
  end

  if attributes.has_key?(:'StrikethroughType')
    self.strikethrough_type = attributes[:'StrikethroughType']
  end

  if attributes.has_key?(:'TextCapType')
    self.text_cap_type = attributes[:'TextCapType']
  end

  if attributes.has_key?(:'Escapement')
    self.escapement = attributes[:'Escapement']
  end

  if attributes.has_key?(:'Spacing')
    self.spacing = attributes[:'Spacing']
  end

  if attributes.has_key?(:'FontColor')
    self.font_color = attributes[:'FontColor']
  end

  if attributes.has_key?(:'HighlightColor')
    self.highlight_color = attributes[:'HighlightColor']
  end

  if attributes.has_key?(:'FontHeight')
    self.font_height = attributes[:'FontHeight']
  end

  if attributes.has_key?(:'NormaliseHeight')
    self.normalise_height = attributes[:'NormaliseHeight']
  end

  if attributes.has_key?(:'ProofDisabled')
    self.proof_disabled = attributes[:'ProofDisabled']
  end

  if attributes.has_key?(:'SmartTagClean')
    self.smart_tag_clean = attributes[:'SmartTagClean']
  end

  if attributes.has_key?(:'KerningMinimalSize')
    self.kerning_minimal_size = attributes[:'KerningMinimalSize']
  end

  if attributes.has_key?(:'Kumimoji')
    self.kumimoji = attributes[:'Kumimoji']
  end

  if attributes.has_key?(:'LanguageId')
    self.language_id = attributes[:'LanguageId']
  end

  if attributes.has_key?(:'AlternativeLanguageId')
    self.alternative_language_id = attributes[:'AlternativeLanguageId']
  end

  if attributes.has_key?(:'IsHardUnderlineFill')
    self.is_hard_underline_fill = attributes[:'IsHardUnderlineFill']
  end

  if attributes.has_key?(:'IsHardUnderlineLine')
    self.is_hard_underline_line = attributes[:'IsHardUnderlineLine']
  end

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

  if attributes.has_key?(:'EffectFormat')
    self.effect_format = attributes[:'EffectFormat']
  end

  if attributes.has_key?(:'LineFormat')
    self.line_format = attributes[:'LineFormat']
  end

  if attributes.has_key?(:'UnderlineFillFormat')
    self.underline_fill_format = attributes[:'UnderlineFillFormat']
  end

  if attributes.has_key?(:'UnderlineLineFormat')
    self.underline_line_format = attributes[:'UnderlineLineFormat']
  end
end

Instance Attribute Details

#alternative_language_idObject

Alternative proving language ID.



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

def alternative_language_id
  @alternative_language_id
end

#effect_formatObject

Effect format.



92
93
94
# File 'lib/aspose_slides_cloud/models/portion.rb', line 92

def effect_format
  @effect_format
end

#escapementObject

Superscript or subscript of the text.



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

def escapement
  @escapement
end

#fill_formatObject

Fill format.



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

def fill_format
  @fill_format
end

#font_boldObject

True for bold font.



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

def font_bold
  @font_bold
end

#font_colorObject

Font color.



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

def font_color
  @font_color
end

#font_heightObject

Font height.



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

def font_height
  @font_height
end

#font_italicObject

True for italic font.



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

def font_italic
  @font_italic
end

#font_underlineObject

Text underline type.



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

def font_underline
  @font_underline
end

#highlight_colorObject

Highlight color.



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

def highlight_color
  @highlight_color
end

#is_hard_underline_fillObject

True if underline style has own FillFormat properties.



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

def is_hard_underline_fill
  @is_hard_underline_fill
end

#is_hard_underline_lineObject

True if underline style has own LineFormat properties.



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

def is_hard_underline_line
  @is_hard_underline_line
end

#kerning_minimal_sizeObject

Minimal font size for kerning.



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

def kerning_minimal_size
  @kerning_minimal_size
end

#kumimojiObject

True if numbers should ignore East-Asian specific vertical text layout.



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

def kumimoji
  @kumimoji
end

#language_idObject

Proving language ID.



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

def language_id
  @language_id
end

#line_formatObject

Line format.



95
96
97
# File 'lib/aspose_slides_cloud/models/portion.rb', line 95

def line_format
  @line_format
end

#normalise_heightObject

True to normalize the text.



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

def normalise_height
  @normalise_height
end

#proof_disabledObject

True if the text proof should be disabled.



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

def proof_disabled
  @proof_disabled
end

#smart_tag_cleanObject

True if smart tag should be cleaned.



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

def smart_tag_clean
  @smart_tag_clean
end

#spacingObject

Intercharacter spacing increment.



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

def spacing
  @spacing
end

#strikethrough_typeObject

Text strikethrough type.



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

def strikethrough_type
  @strikethrough_type
end

#textObject

Text.



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

def text
  @text
end

#text_cap_typeObject

Text capitalization type.



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

def text_cap_type
  @text_cap_type
end

#underline_fill_formatObject

Underline fill format.



98
99
100
# File 'lib/aspose_slides_cloud/models/portion.rb', line 98

def underline_fill_format
  @underline_fill_format
end

#underline_line_formatObject

Underline line format.



101
102
103
# File 'lib/aspose_slides_cloud/models/portion.rb', line 101

def underline_line_format
  @underline_line_format
end

Class Method Details

.attribute_mapObject

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



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/aspose_slides_cloud/models/portion.rb', line 126

def self.attribute_map
  super.merge({
    :'text' => :'Text',
    :'font_bold' => :'FontBold',
    :'font_italic' => :'FontItalic',
    :'font_underline' => :'FontUnderline',
    :'strikethrough_type' => :'StrikethroughType',
    :'text_cap_type' => :'TextCapType',
    :'escapement' => :'Escapement',
    :'spacing' => :'Spacing',
    :'font_color' => :'FontColor',
    :'highlight_color' => :'HighlightColor',
    :'font_height' => :'FontHeight',
    :'normalise_height' => :'NormaliseHeight',
    :'proof_disabled' => :'ProofDisabled',
    :'smart_tag_clean' => :'SmartTagClean',
    :'kerning_minimal_size' => :'KerningMinimalSize',
    :'kumimoji' => :'Kumimoji',
    :'language_id' => :'LanguageId',
    :'alternative_language_id' => :'AlternativeLanguageId',
    :'is_hard_underline_fill' => :'IsHardUnderlineFill',
    :'is_hard_underline_line' => :'IsHardUnderlineLine',
    :'fill_format' => :'FillFormat',
    :'effect_format' => :'EffectFormat',
    :'line_format' => :'LineFormat',
    :'underline_fill_format' => :'UnderlineFillFormat',
    :'underline_line_format' => :'UnderlineLineFormat',
  })
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  super.merge({
    :'text' => :'String',
    :'font_bold' => :'String',
    :'font_italic' => :'String',
    :'font_underline' => :'String',
    :'strikethrough_type' => :'String',
    :'text_cap_type' => :'String',
    :'escapement' => :'Float',
    :'spacing' => :'Float',
    :'font_color' => :'String',
    :'highlight_color' => :'String',
    :'font_height' => :'Float',
    :'normalise_height' => :'String',
    :'proof_disabled' => :'String',
    :'smart_tag_clean' => :'BOOLEAN',
    :'kerning_minimal_size' => :'Float',
    :'kumimoji' => :'String',
    :'language_id' => :'String',
    :'alternative_language_id' => :'String',
    :'is_hard_underline_fill' => :'String',
    :'is_hard_underline_line' => :'String',
    :'fill_format' => :'FillFormat',
    :'effect_format' => :'EffectFormat',
    :'line_format' => :'LineFormat',
    :'underline_fill_format' => :'FillFormat',
    :'underline_line_format' => :'LineFormat',
  })
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/aspose_slides_cloud/models/portion.rb', line 429

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      self_uri == o.self_uri &&
      alternate_links == o.alternate_links &&
      text == o.text &&
      font_bold == o.font_bold &&
      font_italic == o.font_italic &&
      font_underline == o.font_underline &&
      strikethrough_type == o.strikethrough_type &&
      text_cap_type == o.text_cap_type &&
      escapement == o.escapement &&
      spacing == o.spacing &&
      font_color == o.font_color &&
      highlight_color == o.highlight_color &&
      font_height == o.font_height &&
      normalise_height == o.normalise_height &&
      proof_disabled == o.proof_disabled &&
      smart_tag_clean == o.smart_tag_clean &&
      kerning_minimal_size == o.kerning_minimal_size &&
      kumimoji == o.kumimoji &&
      language_id == o.language_id &&
      alternative_language_id == o.alternative_language_id &&
      is_hard_underline_fill == o.is_hard_underline_fill &&
      is_hard_underline_line == o.is_hard_underline_line &&
      fill_format == o.fill_format &&
      effect_format == o.effect_format &&
      line_format == o.line_format &&
      underline_fill_format == o.underline_fill_format &&
      underline_line_format == o.underline_line_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



509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/aspose_slides_cloud/models/portion.rb', line 509

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



575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/aspose_slides_cloud/models/portion.rb', line 575

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



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/aspose_slides_cloud/models/portion.rb', line 476

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


463
464
465
# File 'lib/aspose_slides_cloud/models/portion.rb', line 463

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



469
470
471
# File 'lib/aspose_slides_cloud/models/portion.rb', line 469

def hash
  [self_uri, alternate_links, text, font_bold, font_italic, font_underline, strikethrough_type, text_cap_type, escapement, spacing, font_color, highlight_color, font_height, normalise_height, proof_disabled, smart_tag_clean, kerning_minimal_size, kumimoji, language_id, alternative_language_id, is_hard_underline_fill, is_hard_underline_line, fill_format, effect_format, line_format, underline_fill_format, underline_line_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



295
296
297
298
# File 'lib/aspose_slides_cloud/models/portion.rb', line 295

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



555
556
557
# File 'lib/aspose_slides_cloud/models/portion.rb', line 555

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



561
562
563
564
565
566
567
568
569
# File 'lib/aspose_slides_cloud/models/portion.rb', line 561

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



549
550
551
# File 'lib/aspose_slides_cloud/models/portion.rb', line 549

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



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/aspose_slides_cloud/models/portion.rb', line 302

def valid?
  return false if !super
  font_bold_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless font_bold_validator.valid?(@font_bold)
  font_italic_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless font_italic_validator.valid?(@font_italic)
  font_underline_validator = EnumAttributeValidator.new('String', ['None', 'Words', 'Single', 'Double', 'Heavy', 'Dotted', 'HeavyDotted', 'Dashed', 'HeavyDashed', 'LongDashed', 'HeavyLongDashed', 'DotDash', 'HeavyDotDash', 'DotDotDash', 'HeavyDotDotDash', 'Wavy', 'HeavyWavy', 'DoubleWavy', 'NotDefined'])
  return false unless font_underline_validator.valid?(@font_underline)
  strikethrough_type_validator = EnumAttributeValidator.new('String', ['None', 'Single', 'Double', 'NotDefined'])
  return false unless strikethrough_type_validator.valid?(@strikethrough_type)
  text_cap_type_validator = EnumAttributeValidator.new('String', ['None', 'Small', 'All', 'NotDefined'])
  return false unless text_cap_type_validator.valid?(@text_cap_type)
  normalise_height_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless normalise_height_validator.valid?(@normalise_height)
  proof_disabled_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless proof_disabled_validator.valid?(@proof_disabled)
  kumimoji_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless kumimoji_validator.valid?(@kumimoji)
  is_hard_underline_fill_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless is_hard_underline_fill_validator.valid?(@is_hard_underline_fill)
  is_hard_underline_line_validator = EnumAttributeValidator.new('String', ['False', 'True', 'NotDefined'])
  return false unless is_hard_underline_line_validator.valid?(@is_hard_underline_line)
  true
end