Module: Chordproko

Defined in:
lib/chordproko.rb,
lib/chordproko/line.rb,
lib/chordproko/chord.rb,
lib/chordproko/lyric.rb,
lib/chordproko/sheet.rb,
lib/chordproko/parser.rb,
lib/chordproko/comment.rb,
lib/chordproko/newline.rb,
lib/chordproko/version.rb,
lib/chordproko/directive.rb,
lib/chordproko/transform.rb,
lib/chordproko/plain_song.rb,
lib/chordproko/chord_group.rb

Defined Under Namespace

Classes: Chord, ChordGroup, Comment, Directive, Line, Lyric, Newline, Parser, PlainSong, Sheet, Transform

Constant Summary collapse

VERSION =
"0.1.1"
@@formatter =
"Chordproko::PlainSong"

Class Method Summary collapse

Class Method Details

.set_formatter_class(formatter) ⇒ Object



17
18
19
# File 'lib/chordproko.rb', line 17

def self.set_formatter_class formatter
  @@formatter = formatter
end

.text(song, options = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/chordproko.rb', line 20

def self.text song, options={}
  parsed = Chordproko::Parser.new.parse(song)
  transformed = Transform.new.apply(parsed)
  sheet = Object.const_get(@@formatter).new(transformed, options)
  sheet.to_s
end