class AsposeSlidesCloud::FractionElement

Specifies the fraction object, consisting of a numerator and denominator separated by a fraction bar.

Attributes

denominator[RW]

Denominator

fraction_type[RW]

Fraction type

numerator[RW]

Numerator

Public Class Methods

attribute_map() click to toggle source

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

Calls superclass method
# File lib/aspose_slides_cloud/models/fraction_element.rb, line 38
def self.attribute_map
  super.merge({
    :'fraction_type' => :'FractionType',
    :'numerator' => :'Numerator',
    :'denominator' => :'Denominator',
  })
end
new(attributes = {}) click to toggle source

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

Calls superclass method
# File lib/aspose_slides_cloud/models/fraction_element.rb, line 57
def initialize(attributes = {})
  super

  if attributes.has_key?(:'FractionType')
    self.fraction_type = attributes[:'FractionType']
  end

  if attributes.has_key?(:'Numerator')
    self.numerator = attributes[:'Numerator']
  end

  if attributes.has_key?(:'Denominator')
    self.denominator = attributes[:'Denominator']
  end
  self.type = 'Fraction'
end
swagger_types() click to toggle source

Attribute type mapping.

Calls superclass method
# File lib/aspose_slides_cloud/models/fraction_element.rb, line 47
def self.swagger_types
  super.merge({
    :'fraction_type' => :'String',
    :'numerator' => :'MathElement',
    :'denominator' => :'MathElement',
  })
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/fraction_element.rb, line 102
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      type == o.type &&
      fraction_type == o.fraction_type &&
      numerator == o.numerator &&
      denominator == o.denominator
end
eql?(o) click to toggle source

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

# File lib/aspose_slides_cloud/models/fraction_element.rb, line 113
def eql?(o)
  self == o
end
fraction_type=(fraction_type) click to toggle source

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

# File lib/aspose_slides_cloud/models/fraction_element.rb, line 92
def fraction_type=(fraction_type)
  validator = EnumAttributeValidator.new('String', ['Bar', 'Skewed', 'Linear', 'NoBar'])
  unless validator.valid?(fraction_type)
    fail ArgumentError, 'invalid value for "fraction_type", must be one of #{validator.allowable_values}.'
  end
  @fraction_type = fraction_type
end
hash() click to toggle source

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

# File lib/aspose_slides_cloud/models/fraction_element.rb, line 119
def hash
  [type, fraction_type, numerator, denominator].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

Calls superclass method
# File lib/aspose_slides_cloud/models/fraction_element.rb, line 76
def list_invalid_properties
  invalid_properties = super
  invalid_properties
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
# File lib/aspose_slides_cloud/models/fraction_element.rb, line 83
def valid?
  return false if !super
  fraction_type_validator = EnumAttributeValidator.new('String', ['Bar', 'Skewed', 'Linear', 'NoBar'])
  return false unless fraction_type_validator.valid?(@fraction_type)
  true
end