class HexaPDF::Layout::Style::Quad

Parent

A Quad holds four values and allows them to be accessed by the names top, right, bottom and left. Quads are normally used for holding values pertaining to boxes, like margins, paddings or borders.

Attributes

bottom[RW]

The value for bottom.

left[RW]

The value for left.

right[RW]

The value for right.

top[RW]

The value for top.

Public Class Methods

new(obj)

Creates a new Quad object. See set for more information.

Public Instance Methods

set(value)
set(array)
set(quad)

Sets all values of the quad.

  • If a single value is provided that is neither a Quad nor an array, it is handled as if an array with one value was given.

  • If a Quad is provided, its values are used.

  • If an array is provided, it depends on the number of elemens in it:

    • One value: All attributes are set to the same value.

    • Two values: Top and bottom are set to the first value, left and right to the second value.

    • Three values: Top is set to the first, left and right to the second, and bottom to the third value.

    • Four or more values: Top is set to the first, right to the second, bottom to the third and left to the fourth value.

simple?()

Returns true if the quad effectively contains only one value.