Class: Uke::Fretboard
- Inherits:
-
Object
- Object
- Uke::Fretboard
- Defined in:
- lib/uke/fretboard.rb
Constant Summary collapse
- STYLES =
{ small: { open: " ⚪", finger: " ●" }, large: { open: " ○", finger: "⬤ " }, }
Instance Method Summary collapse
-
#initialize(chord, style = nil) ⇒ Fretboard
constructor
A new instance of Fretboard.
- #lines ⇒ Object
Constructor Details
#initialize(chord, style = nil) ⇒ Fretboard
Returns a new instance of Fretboard.
8 9 10 11 12 13 |
# File 'lib/uke/fretboard.rb', line 8 def initialize(chord, style = nil) @chord = chord @style = style.to_sym raise ArgumentError, 'Unknown style' unless STYLES[@style] @config = chord_to_config(@chord) end |
Instance Method Details
#lines ⇒ Object
15 16 17 |
# File 'lib/uke/fretboard.rb', line 15 def lines (TEMPLATE % @config).split($/) end |