Class: WTFChord::Formatters::Default

Inherits:
Base
  • Object
show all
Includes:
RomanNumbersHelper
Defined in:
lib/wtf_chord/formatters/default.rb

Constant Summary collapse

OPEN =
"|".freeze
HORIZ =
"".freeze
SPACE =
"  ".freeze
BULL =
"\u25C9".freeze
NEWLINE =
"\n".freeze
COMPLEXITY_FORMAT =
"  (complexity: %.2f)".freeze
EMPTY_STRING =
Array.new(FRETS, OPEN).freeze

Constants inherited from Base

Base::FRETS

Instance Method Summary collapse

Methods included from RomanNumbersHelper

#romanize

Methods inherited from Base

#actual_strings, #initialize, separator, to_proc, with_rates, #with_rates?

Constructor Details

This class inherits a constructor from WTFChord::Formatters::Base

Instance Method Details

#drawObject



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/wtf_chord/formatters/default.rb', line 16

def draw
  <<-EOF.gsub(/^\s+\|/, '')
    |[ #{head} ]  #{capo}
    | #{border}
    #{fret_rows.map.with_index { |row, index|
   "  |  #{row}  #{roman_min_fret if index == 0}"
    }.join("\n")}
    | #{border}
    |  #{string_keys}#{rate}
  EOF
end