Class: Prawntocat::PDF
- Inherits:
-
Object
- Object
- Prawntocat::PDF
- Defined in:
- lib/prawntocat/pdf.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(repo, pdf_name) ⇒ PDF
constructor
A new instance of PDF.
- #issues ⇒ Object
Constructor Details
#initialize(repo, pdf_name) ⇒ PDF
Returns a new instance of PDF.
6 7 8 9 |
# File 'lib/prawntocat/pdf.rb', line 6 def initialize repo, pdf_name @repo = repo @pdf_name = pdf_name || repo.gsub("/", "_").+(".pdf") end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/prawntocat/pdf.rb', line 15 def generate Prawn::Document.generate(@pdf_name) do |doc| doc.text("Issues for #{@repo}", size: 20) doc.move_down 20 issues.each do |issue| doc.text("#{issue.title}\n", :style => :bold) end end end |
#issues ⇒ Object
11 12 13 |
# File 'lib/prawntocat/pdf.rb', line 11 def issues @issues ||= Prawntocat::Issues.new(@repo) end |