class AsposeSlidesCloud::GradientFill

Represents gradient fill format

Attributes

direction[RW]

Gradient style.

is_scaled[RW]

True if the gradient is scaled.

linear_angle[RW]

Gradient angle.

shape[RW]

Gradient shape.

stops[RW]

Gradient stops.

tile_flip[RW]

Gradient flipping mode.

Public Class Methods

attribute_map() click to toggle source

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

# 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
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

Calls superclass method AsposeSlidesCloud::FillFormat::new
# 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
swagger_types() click to toggle source

Attribute type mapping.

# 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

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# 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
direction=(direction) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] direction Object to be assigned

# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 125
def direction=(direction)
  validator = EnumAttributeValidator.new('String', ['FromCorner1', 'FromCorner2', 'FromCorner3', 'FromCorner4', 'FromCenter', 'NotDefined'])
  unless validator.valid?(direction)
    fail ArgumentError, 'invalid value for "direction", must be one of #{validator.allowable_values}.'
  end
  @direction = direction
end
eql?(o) click to toggle source

@see the ‘==` method @param [Object] Object to be compared

# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 169
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# 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_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 105
def list_invalid_properties
  invalid_properties = super
  invalid_properties
end
shape=(shape) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] shape Object to be assigned

# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 135
def shape=(shape)
  validator = EnumAttributeValidator.new('String', ['Linear', 'Rectangle', 'Radial', 'Path', 'NotDefined'])
  unless validator.valid?(shape)
    fail ArgumentError, 'invalid value for "shape", must be one of #{validator.allowable_values}.'
  end
  @shape = shape
end
tile_flip=(tile_flip) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] tile_flip Object to be assigned

# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 145
def tile_flip=(tile_flip)
  validator = EnumAttributeValidator.new('String', ['NoFlip', 'FlipX', 'FlipY', 'FlipBoth', 'NotDefined'])
  unless validator.valid?(tile_flip)
    fail ArgumentError, 'invalid value for "tile_flip", must be one of #{validator.allowable_values}.'
  end
  @tile_flip = tile_flip
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

Calls superclass method AsposeSlidesCloud::FillFormat#valid?
# 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