Class: GridifyPdf::Gridifier
- Inherits:
-
Object
- Object
- GridifyPdf::Gridifier
- Defined in:
- lib/gridify_pdf/gridifier.rb
Instance Attribute Summary collapse
-
#cell_width ⇒ Object
readonly
Returns the value of attribute cell_width.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
- #gridify ⇒ Object
-
#initialize(input, cell_width: 50) ⇒ Gridifier
constructor
A new instance of Gridifier.
Constructor Details
#initialize(input, cell_width: 50) ⇒ Gridifier
Returns a new instance of Gridifier.
7 8 9 10 |
# File 'lib/gridify_pdf/gridifier.rb', line 7 def initialize(input, cell_width: 50) @input = input @cell_width = cell_width end |
Instance Attribute Details
#cell_width ⇒ Object (readonly)
Returns the value of attribute cell_width.
5 6 7 |
# File 'lib/gridify_pdf/gridifier.rb', line 5 def cell_width @cell_width end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
5 6 7 |
# File 'lib/gridify_pdf/gridifier.rb', line 5 def input @input end |
Instance Method Details
#gridify ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/gridify_pdf/gridifier.rb', line 12 def gridify output_pdf = CombinePDF.new parsed_input.pages.each do |input_page| output_pdf << input_page end = CombinePDF.parse(.render) .pages.slice(1..).each_with_index do |, index| output_pdf.pages[index] << end output_pdf.to_pdf end |