Class: Pdfmult::Layout
- Inherits:
-
Object
- Object
- Pdfmult::Layout
- Defined in:
- lib/pdfmult.rb
Overview
Class for the page layout.
Create an instance with Layout.new, specifying the number of pages to put on one page. Layout#geometry returns the geometry string.
Constant Summary collapse
- GEOMETRY =
{ 2 => '2x1', 4 => '2x2', 8 => '4x2', 9 => '3x3', 16 => '4x4' }
Instance Attribute Summary collapse
-
#geometry ⇒ Object
readonly
Returns the value of attribute geometry.
-
#pages ⇒ Object
readonly
Returns the value of attribute pages.
Instance Method Summary collapse
-
#initialize(pages) ⇒ Layout
constructor
A new instance of Layout.
- #landscape? ⇒ Boolean
Constructor Details
#initialize(pages) ⇒ Layout
Returns a new instance of Layout.
168 169 170 171 |
# File 'lib/pdfmult.rb', line 168 def initialize(pages) @pages = pages @geometry = GEOMETRY[pages] end |
Instance Attribute Details
#geometry ⇒ Object (readonly)
Returns the value of attribute geometry.
158 159 160 |
# File 'lib/pdfmult.rb', line 158 def geometry @geometry end |
#pages ⇒ Object (readonly)
Returns the value of attribute pages.
158 159 160 |
# File 'lib/pdfmult.rb', line 158 def pages @pages end |
Instance Method Details
#landscape? ⇒ Boolean
173 174 175 |
# File 'lib/pdfmult.rb', line 173 def landscape? ['2x1', '4x2'].include?(geometry) end |