class Song::Verse
Attributes
chords[RW]
chorus[RW]
lines[RW]
Public Class Methods
new()
click to toggle source
# File Creator/song.rb, line 27 def initialize @lines = [] end
Public Instance Methods
capo!(fret)
click to toggle source
# File Creator/capo.rb, line 36 def capo!(fret) lines.each{|l| l.capo!(fret)} end
chorus?()
click to toggle source
# File Creator/song.rb, line 30 def chorus?; @chorus; end
chorus_indicator?()
click to toggle source
# File Creator/song.rb, line 31 def chorus_indicator?; chorus? and lines.empty?; end
to_html()
click to toggle source
# File Creator/html_formatter.rb, line 21 def to_html lstr = lines.map(&:to_html).join("\n") if chorus_indicator? lstr = "<div class='chorusindicator'>[Chorus]</div>" elsif chorus? lstr = "<span class='chorusindicator'>Chorus:</span>\n<div class='chorus'>#{lstr}</div>" end return lstr end
to_latex()
click to toggle source
# File Creator/latex_formatter.rb, line 22 def to_latex lstr = lines.collect{|l| "#{l.to_latex} \\\\\\*"}.join("\n") return "" if lstr.strip.empty? lstr = "\\chorus\n" + lstr if chorus? template = "\\begin{songverse} #{lstr} \\end{songverse}" return template end