class Uke
Constants
- CHORDS
- CHORDS_RAW
compare ukulele-chords.com and ukulelehelper.com
- ENHARMONIC_EQUIVALENTS
- VERSION
Public Instance Methods
print_chord_list()
click to toggle source
# File lib/uke.rb, line 8 def print_chord_list puts Uke::CHORDS.keys.join " " end
print_chords(which, style = nil)
click to toggle source
# File lib/uke.rb, line 12 def print_chords(which, style = nil) Array(which).each{ |chord_name| chords = CHORDS[chord_name] if !chords.empty? puts chords.reduce( chord_name_to_ascii_lines(chord_name) ){ |old_lines, chord| old_lines.zip(Fretboard.new(chord, style).lines).map(&:join) }.join($/) else $stderr.puts "\n #{chord_name} not found" end } end
Private Instance Methods
chord_name_to_ascii_lines(chord)
click to toggle source
# File lib/uke.rb, line 29 def chord_name_to_ascii_lines(chord) a = Artii::Base.new# font: 'roman' res = [" ", " ", " "] res += a.asciify(chord).split($/) res += [" "] max = res.max_by(&:size).size res.map{ |l| " " + l.ljust(max) } end