class AsposeSlidesCloud::PatternFill

Represents Pattern Fill

Attributes

back_color[RW]

Gets or sets the back color of the pattern fill.

fore_color[RW]

Gets or sets the fore color of the pattern fill.

style[RW]

Gets or sets the style of pattern fill.

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/pattern_fill.rb, line 38
def self.attribute_map
  super.merge({
    :'back_color' => :'BackColor',
    :'fore_color' => :'ForeColor',
    :'style' => :'Style',
  })
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/pattern_fill.rb, line 57
def initialize(attributes = {})
  super

  if attributes.has_key?(:'BackColor')
    self.back_color = attributes[:'BackColor']
  end

  if attributes.has_key?(:'ForeColor')
    self.fore_color = attributes[:'ForeColor']
  end

  if attributes.has_key?(:'Style')
    self.style = attributes[:'Style']
  end
  self.type = 'Pattern'
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/aspose_slides_cloud/models/pattern_fill.rb, line 47
def self.swagger_types
  super.merge({
    :'back_color' => :'String',
    :'fore_color' => :'String',
    :'style' => :'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/pattern_fill.rb, line 107
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      back_color == o.back_color &&
      fore_color == o.fore_color &&
      style == o.style
end
eql?(o) click to toggle source

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

# File lib/aspose_slides_cloud/models/pattern_fill.rb, line 118
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/pattern_fill.rb, line 124
def hash
  [type, back_color, fore_color, style].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/pattern_fill.rb, line 76
def list_invalid_properties
  invalid_properties = super
  if @style.nil?
    invalid_properties.push('invalid value for "style", style cannot be nil.')
  end

  invalid_properties
end
style=(style) click to toggle source

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

# File lib/aspose_slides_cloud/models/pattern_fill.rb, line 97
def style=(style)
  validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])
  unless validator.valid?(style)
    fail ArgumentError, 'invalid value for "style", must be one of #{validator.allowable_values}.'
  end
  @style = style
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/pattern_fill.rb, line 87
def valid?
  return false if !super
  return false if @style.nil?
  style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])
  return false unless style_validator.valid?(@style)
  true
end