Class: AsposeSlidesCloud::Placeholder

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

Overview

Represents placeholder

Instance Attribute Summary collapse

Attributes inherited from ResourceBase

#alternate_links, #self_uri

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseObject

#_deserialize, #_to_hash, #build_from_hash, #to_body, #to_hash, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ Placeholder

Initializes the object

Parameters:

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

    Model attributes in the form of hash



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 67

def initialize(attributes = {})
  super

  if attributes.has_key?(:'Index')
    self.index = attributes[:'Index']
  end

  if attributes.has_key?(:'Orientation')
    self.orientation = attributes[:'Orientation']
  end

  if attributes.has_key?(:'Size')
    self.size = attributes[:'Size']
  end

  if attributes.has_key?(:'Type')
    self.type = attributes[:'Type']
  end

  if attributes.has_key?(:'Shape')
    self.shape = attributes[:'Shape']
  end
end

Instance Attribute Details

#indexObject

Index.



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

def index
  @index
end

#orientationObject

Orientation.



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

def orientation
  @orientation
end

#shapeObject

Shape link.



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

def shape
  @shape
end

#sizeObject

Size.



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

def size
  @size
end

#typeObject

Placeholder type.



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

def type
  @type
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 44

def self.attribute_map
  super.merge({
    :'index' => :'Index',
    :'orientation' => :'Orientation',
    :'size' => :'Size',
    :'type' => :'Type',
    :'shape' => :'Shape',
  })
end

.swagger_typesObject

Attribute type mapping.



55
56
57
58
59
60
61
62
63
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 55

def self.swagger_types
  super.merge({
    :'index' => :'Integer',
    :'orientation' => :'String',
    :'size' => :'String',
    :'type' => :'String',
    :'shape' => :'ResourceUri',
  })
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



163
164
165
166
167
168
169
170
171
172
173
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 163

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      self_uri == o.self_uri &&
      alternate_links == o.alternate_links &&
      index == o.index &&
      orientation == o.orientation &&
      size == o.size &&
      type == o.type &&
      shape == o.shape
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


177
178
179
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 177

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



183
184
185
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 183

def hash
  [self_uri, alternate_links, index, orientation, size, type, shape].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 93

def list_invalid_properties
  invalid_properties = super
  if @index.nil?
    invalid_properties.push('invalid value for "index", index cannot be nil.')
  end

  if @orientation.nil?
    invalid_properties.push('invalid value for "orientation", orientation cannot be nil.')
  end

  if @size.nil?
    invalid_properties.push('invalid value for "size", size cannot be nil.')
  end

  if @type.nil?
    invalid_properties.push('invalid value for "type", type cannot be nil.')
  end

  invalid_properties
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/aspose_slides_cloud/models/placeholder.rb', line 116

def valid?
  return false if !super
  return false if @index.nil?
  return false if @orientation.nil?
  orientation_validator = EnumAttributeValidator.new('String', ['Horizontal', 'Vertical'])
  return false unless orientation_validator.valid?(@orientation)
  return false if @size.nil?
  size_validator = EnumAttributeValidator.new('String', ['Full', 'Half', 'Quarter'])
  return false unless size_validator.valid?(@size)
  return false if @type.nil?
  type_validator = EnumAttributeValidator.new('String', ['Title', 'Body', 'CenteredTitle', 'Subtitle', 'DateAndTime', 'SlideNumber', 'Footer', 'Header', 'Object', 'Chart', 'Table', 'ClipArt', 'Diagram', 'Media', 'SlideImage', 'Picture'])
  return false unless type_validator.valid?(@type)
  true
end