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.
98 99 100 |
# File 'lib/pdf_combinator.rb', line 98 def initialize(pdf_page) @page = pdf_page end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
96 97 98 |
# File 'lib/pdf_combinator.rb', line 96 def page @page end |
Instance Method Details
#orientation(new_orientation = nil) ⇒ Object
102 103 104 105 |
# File 'lib/pdf_combinator.rb', line 102 def orientation(new_orientation = nil) page.rotate(-90) if new_orientation && page.orientation != new_orientation page.orientation end |
#orientation=(new_orientation) ⇒ Object
107 108 109 110 111 |
# File 'lib/pdf_combinator.rb', line 107 def orientation=(new_orientation) return unless page.orientation != new_orientation page.rotate(-90) end |