Module: TeachingPrintables
- Extended by:
- TeachingPrintables
- Included in:
- TeachingPrintables
- Defined in:
- lib/teaching_printables.rb,
lib/teaching_printables/printing/templates.rb,
lib/teaching_printables/grid_sheet/grid_sheet.rb
Defined Under Namespace
Modules: Printing
Classes: GridSheet, PictureGridSheet
Constant Summary
collapse
- BASEDIR =
The base source directory as installed on the system
File.expand_path(File.join(dir, '..'))
- GRAPHIC_EXTENSIONS =
[".jpg",".JPG",".png",".jpeg"]
Instance Method Summary
collapse
Instance Method Details
#grid_sheet_with_content(content_array) ⇒ Object
40
41
42
43
44
45
|
# File 'lib/teaching_printables.rb', line 40
def grid_sheet_with_content(content_array)
gs = GridSheet.new(TeachingPrintables::Printing::Templates::AVERY5371)
gs.make_grid(content_array)
gs.save_as("mygrid.pdf")
puts "Sheet saved as mygrid.pdf"
end
|
#is_image_file?(filename) ⇒ Boolean
20
21
22
|
# File 'lib/teaching_printables.rb', line 20
def is_image_file?(filename)
!filename.start_with?(".") && GRAPHIC_EXTENSIONS.include?(File.extname(filename))
end
|
#test_grid_sheet ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/teaching_printables.rb', line 32
def test_grid_sheet
gs = GridSheet.new(TeachingPrintables::Printing::Templates::AVERY5371)
content = %W[crow mow low slow tow boat moat goat oat float feet seat treat beep speed need steep wait train rain paint way play day say bay hay stay lay may ]
gs.make_grid(content)
gs.save_as("mygrid.pdf")
gs
end
|