summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pdf_form.rb17
-rw-r--r--lib/song.rb7
2 files changed, 20 insertions, 4 deletions
diff --git a/lib/pdf_form.rb b/lib/pdf_form.rb
index 57db881..c472fd9 100644
--- a/lib/pdf_form.rb
+++ b/lib/pdf_form.rb
@@ -25,7 +25,17 @@ class PDFForm
next_line
field("Medlemmer:", @band.members)
- field("Låter:", @band.songs)
+ next_line
+ subheading("Låter:")
+ @band.songs.each do |song|
+ field("Tittel", song.to_s)
+ field("ISRC-kode:", song.isrc)
+ field("Utøvere:", song.performers)
+ field("Komponister:", song.composers)
+ field("Merknad:", song.notes)
+ next_line
+ @document.stroke { @document.horizontal_rule }
+ end
@document.render_file "#{@band.name}.pdf"
end
@@ -44,6 +54,11 @@ class PDFForm
@document.text "Påmelding til Norsk Urskog 2016", :size => 20
end
+ def subheading(text)
+ @document.text text, :size => 16, :style => :bold
+ @document.stroke { @document.horizontal_rule }
+ end
+
def next_line
@document.move_down one_line
end
diff --git a/lib/song.rb b/lib/song.rb
index e20b5b8..93172f2 100644
--- a/lib/song.rb
+++ b/lib/song.rb
@@ -1,11 +1,12 @@
class Song
- attr_reader :title, :time, :composers, :performers, :notes
+ attr_reader :title, :time, :isrc, :composers, :performers, :notes
def initialize(params)
@title = params['title']
@time = params['time']
- @composers = params['composers']
- @performers = params['performers']
+ @isrc = params['isrc']
+ @composers = params['composers'].split("\n")
+ @performers = params['performers'].split("\n")
@notes = params['notes']
end