class HexaPDF:: Layout:: Style:: Quad
| Parent | Object |
|---|
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
The value for bottom.
The value for left.
The value for right.
The value for top.
Public Class Methods
Public Instance Methods
Sets all values of the quad and returns it.
-
If a single value is provided that is neither a
Quadnor an array nor a hash, it is handled as if an array with one value was given. -
If a
Quadis 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.
-
-
If a hash is provided, the keys
:top,:bottom,:leftand:rightare used to set the respective value. All unspecified keys that have not been set before are set to 0.
Returns true if the quad effectively contains only one value.