Class: PdfCombinator::PdfPage
- Inherits:
-
Object
- Object
- PdfCombinator::PdfPage
- Defined in:
- lib/pdf_combinator.rb
Overview
Decorator to mimic CombinedPdf syntax
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
-
#initialize(pdf_page) ⇒ PdfPage
constructor
A new instance of PdfPage.
-
#orientation(new_orientation = nil) ⇒ Symbol
The page's current orientation (rotates first when an argument is given).
-
#orientation=(new_orientation) ⇒ void
Rotates the page to the new orientation.
Constructor Details
#initialize(pdf_page) ⇒ PdfPage
Returns a new instance of PdfPage.
107 108 109 |
# File 'lib/pdf_combinator.rb', line 107 def initialize(pdf_page) @page = pdf_page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
105 106 107 |
# File 'lib/pdf_combinator.rb', line 105 def page @page end |
Instance Method Details
#orientation(new_orientation = nil) ⇒ Symbol
Returns the page's current orientation (rotates first when an argument is given).
112 113 114 115 |
# File 'lib/pdf_combinator.rb', line 112 def orientation(new_orientation = nil) page.rotate(-90) if new_orientation && page.orientation != new_orientation page.orientation end |
#orientation=(new_orientation) ⇒ void
This method returns an undefined value.
Returns rotates the page to the new orientation.
118 119 120 121 122 |
# File 'lib/pdf_combinator.rb', line 118 def orientation=(new_orientation) return unless page.orientation != new_orientation page.rotate(-90) end |