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) ⇒ Object
- #orientation=(new_orientation) ⇒ Object
Constructor Details
#initialize(pdf_page) ⇒ PdfPage
Returns a new instance of PdfPage.
91 92 93 |
# File 'lib/pdf_combinator.rb', line 91 def initialize(pdf_page) @page = pdf_page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
89 90 91 |
# File 'lib/pdf_combinator.rb', line 89 def page @page end |
Instance Method Details
#orientation(new_orientation = nil) ⇒ Object
95 96 97 98 |
# File 'lib/pdf_combinator.rb', line 95 def orientation(new_orientation = nil) page.rotate(-90) if new_orientation && page.orientation != new_orientation page.orientation end |
#orientation=(new_orientation) ⇒ Object
100 101 102 103 104 |
# File 'lib/pdf_combinator.rb', line 100 def orientation=(new_orientation) return unless page.orientation != new_orientation page.rotate(-90) end |