Class: PdfCombinator::PdfPage

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf_combinator.rb

Overview

Decorator to mimic CombinedPdf syntax

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pageObject (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