class AsposeSlidesCloud::Legend
Represents a chart legend
Attributes
Get or sets the effect format.
Get or sets the fill format.
Get or sets value determines the visibility of legend
Height
Get or sets the line format.
true if other elements are allowed to overlay the legend
position
Width
the X location
the Y location
Public Class Methods
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 59 def self.attribute_map { :'position' => :'Position', :'x' => :'X', :'y' => :'Y', :'width' => :'Width', :'height' => :'Height', :'overlay' => :'Overlay', :'fill_format' => :'FillFormat', :'effect_format' => :'EffectFormat', :'line_format' => :'LineFormat', :'has_legend' => :'HasLegend', } end
Attribute mapping from ruby-style variable name to JSON key.
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 92 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'Position') self.position = attributes[:'Position'] end if attributes.has_key?(:'X') self.x = attributes[:'X'] end if attributes.has_key?(:'Y') self.y = attributes[:'Y'] end if attributes.has_key?(:'Width') self.width = attributes[:'Width'] end if attributes.has_key?(:'Height') self.height = attributes[:'Height'] end if attributes.has_key?(:'Overlay') self.overlay = attributes[:'Overlay'] end if attributes.has_key?(:'FillFormat') self.fill_format = attributes[:'FillFormat'] end if attributes.has_key?(:'EffectFormat') self.effect_format = attributes[:'EffectFormat'] end if attributes.has_key?(:'LineFormat') self.line_format = attributes[:'LineFormat'] end if attributes.has_key?(:'HasLegend') self.has_legend = attributes[:'HasLegend'] end end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 75 def self.swagger_types { :'position' => :'String', :'x' => :'Float', :'y' => :'Float', :'width' => :'Float', :'height' => :'Float', :'overlay' => :'BOOLEAN', :'fill_format' => :'FillFormat', :'effect_format' => :'EffectFormat', :'line_format' => :'LineFormat', :'has_legend' => :'BOOLEAN', } end
Attribute type mapping.
Public Instance Methods
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 166 def ==(o) return true if self.equal?(o) self.class == o.class && position == o.position && x == o.x && y == o.y && width == o.width && height == o.height && overlay == o.overlay && fill_format == o.fill_format && effect_format == o.effect_format && line_format == o.line_format && has_legend == o.has_legend end
Checks equality by comparing each attribute. @param [Object] Object to be compared
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 183 def eql?(o) self == o end
@see the ‘==` method @param [Object] Object to be compared
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 189 def hash [position, x, y, width, height, overlay, fill_format, effect_format, line_format, has_legend].hash end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 141 def list_invalid_properties invalid_properties = Array.new invalid_properties end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 156 def position=(position) validator = EnumAttributeValidator.new('String', ['Bottom', 'Left', 'Right', 'Top', 'TopRight']) unless validator.valid?(position) fail ArgumentError, 'invalid value for "position", must be one of #{validator.allowable_values}.' end @position = position end
Custom attribute writer method checking allowed values (enum). @param [Object] position Object to be assigned
Source
# File lib/aspose_slides_cloud/models/legend.rb, line 148 def valid? position_validator = EnumAttributeValidator.new('String', ['Bottom', 'Left', 'Right', 'Top', 'TopRight']) return false unless position_validator.valid?(@position) true end
Check to see if the all the properties in the model are valid @return true if the model is valid