Module: TeachingPrintables::Templatable

Includes:
Gridable
Defined in:
lib/teaching_printables/templatable.rb

Overview

Creates grid layouts for flashcards or math sheets. Delegates Prawn methods to Prawn::Document.

Constant Summary collapse

{
  compulabel: {
    :page_layout => :portrait, 
    :page_size => "LETTER",
    :top_margin => 0.25.in,
    :bottom_margin => 0.25.in,
    :right_margin => 0.in,
    :left_margin => 0.in,
    :columns => 3,
    :rows => 7,
    :gutter => 10
  },

  avery5371: {
    :page_layout => :portrait, 
    :page_size => "LETTER",
    :top_margin => 0.5.in,
    :bottom_margin => 0.5.in,
    :right_margin => 0.75.in,
    :left_margin => 0.75.in,
    :columns => 2,
    :rows => 5,
    :gutter => 0
  }
}

Instance Attribute Summary

Attributes included from Gridable

#grid_column_width, #grid_columns, #grid_gutter, #grid_row_height, #grid_rows

Instance Method Summary collapse

Methods included from Gridable

#add_grid_content, #place_contents_in_gridbox, #update_grid_options

Instance Method Details

#create_page_with_template(template) ⇒ Object



36
37
38
39
# File 'lib/teaching_printables/templatable.rb', line 36

def create_page_with_template(template)
  start_new_page(PRINT_TEMPLATES[template])
  update_grid_options(PRINT_TEMPLATES[template])
end