Class: AsposeSlidesCloud::GradientFill

Inherits:
FillFormat show all
Defined in:
lib/aspose_slides_cloud/models/gradient_fill.rb

Overview

Represents gradient fill format

Instance Attribute Summary collapse

Attributes inherited from FillFormat

#type

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 = {}) ⇒ GradientFill

Initializes the object

Parameters:

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

    Model attributes in the form of hash



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 72

def initialize(attributes = {})
  super

  if attributes.has_key?(:'Direction')
    self.direction = attributes[:'Direction']
  end

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

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

  if attributes.has_key?(:'LinearAngle')
    self.linear_angle = attributes[:'LinearAngle']
  end

  if attributes.has_key?(:'IsScaled')
    self.is_scaled = attributes[:'IsScaled']
  end

  if attributes.has_key?(:'TileFlip')
    self.tile_flip = attributes[:'TileFlip']
  end
  self.type = 'Gradient'
end

Instance Attribute Details

#directionObject

Gradient style.



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

def direction
  @direction
end

#is_scaledObject

True if the gradient is scaled.



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

def is_scaled
  @is_scaled
end

#linear_angleObject

Gradient angle.



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

def linear_angle
  @linear_angle
end

#shapeObject

Gradient shape.



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

def shape
  @shape
end

#stopsObject

Gradient stops.



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

def stops
  @stops
end

#tile_flipObject

Gradient flipping mode.



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

def tile_flip
  @tile_flip
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 47

def self.attribute_map
  super.merge({
    :'direction' => :'Direction',
    :'shape' => :'Shape',
    :'stops' => :'Stops',
    :'linear_angle' => :'LinearAngle',
    :'is_scaled' => :'IsScaled',
    :'tile_flip' => :'TileFlip',
  })
end

.swagger_typesObject

Attribute type mapping.



59
60
61
62
63
64
65
66
67
68
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 59

def self.swagger_types
  super.merge({
    :'direction' => :'String',
    :'shape' => :'String',
    :'stops' => :'Array<GradientFillStop>',
    :'linear_angle' => :'Float',
    :'is_scaled' => :'BOOLEAN',
    :'tile_flip' => :'String',
  })
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



180
181
182
183
184
185
186
187
188
189
190
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 180

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      direction == o.direction &&
      shape == o.shape &&
      stops == o.stops &&
      linear_angle == o.linear_angle &&
      is_scaled == o.is_scaled &&
      tile_flip == o.tile_flip
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


194
195
196
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 194

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



200
201
202
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 200

def hash
  [type, direction, shape, stops, linear_angle, is_scaled, tile_flip].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 105

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

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

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

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

  if @tile_flip.nil?
    invalid_properties.push('invalid value for "tile_flip", tile_flip 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



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 132

def valid?
  return false if !super
  return false if @direction.nil?
  direction_validator = EnumAttributeValidator.new('String', ['FromCorner1', 'FromCorner2', 'FromCorner3', 'FromCorner4', 'FromCenter', 'NotDefined'])
  return false unless direction_validator.valid?(@direction)
  return false if @shape.nil?
  shape_validator = EnumAttributeValidator.new('String', ['Linear', 'Rectangle', 'Radial', 'Path', 'NotDefined'])
  return false unless shape_validator.valid?(@shape)
  return false if @linear_angle.nil?
  return false if @is_scaled.nil?
  return false if @tile_flip.nil?
  tile_flip_validator = EnumAttributeValidator.new('String', ['NoFlip', 'FlipX', 'FlipY', 'FlipBoth', 'NotDefined'])
  return false unless tile_flip_validator.valid?(@tile_flip)
  true
end