class AsposeSlidesCloud::GradientFill
Represents gradient fill format
Attributes
Gradient style.
True if the gradient is scaled.
Gradient angle.
Gradient shape.
Gradient stops.
Gradient flipping mode.
Public Class Methods
Source
# 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
Attribute mapping from ruby-style variable name to JSON key.
AsposeSlidesCloud::FillFormat::attribute_map
Source
# 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
Initializes the object @param [Hash] attributes Model attributes in the form of hash
AsposeSlidesCloud::FillFormat::new
Source
# 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
Attribute type mapping.
AsposeSlidesCloud::FillFormat::swagger_types
Public Instance Methods
Source
# 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
Checks equality by comparing each attribute. @param [Object] Object to be compared
Source
# 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
Custom attribute writer method checking allowed values (enum). @param [Object] direction Object to be assigned
Source
# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 169 def eql?(o) self == o end
@see the ‘==` method @param [Object] Object to be compared
Source
# 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
Calculates hash code according to all attributes. @return [Fixnum] Hash code
Source
# File lib/aspose_slides_cloud/models/gradient_fill.rb, line 105 def list_invalid_properties invalid_properties = super invalid_properties end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
AsposeSlidesCloud::FillFormat#list_invalid_properties
Source
# 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
Custom attribute writer method checking allowed values (enum). @param [Object] shape Object to be assigned
Source
# 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
Custom attribute writer method checking allowed values (enum). @param [Object] tile_flip
Object to be assigned
Source
# 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
Check to see if the all the properties in the model are valid @return true if the model is valid
AsposeSlidesCloud::FillFormat#valid?