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



155
156
157
158
159
160
161
162
163
164
165
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 155

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


169
170
171
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 169

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



175
176
177
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 175

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

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



112
113
114
115
116
117
118
119
120
121
# File 'lib/aspose_slides_cloud/models/gradient_fill.rb', line 112

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