Class: Fretboard::Notes
- Inherits:
-
Object
- Object
- Fretboard::Notes
- Defined in:
- lib/fretboard/notes.rb
Overview
rubocop:disable Style/Documentation
Constant Summary collapse
- BASIS_NOTES =
Fretboard::Notes.all(:both) Fretboard::Notes.all(:sharp) Fretboard::Notes.all(:flat)
{ 1 => 'C', 2 => ['C#', 'Db'], 3 => 'D', 4 => ['D#', 'Eb'], 5 => 'E', 6 => 'F', 7 => ['F#', 'Gb'], 8 => 'G', 9 => ['G#', 'Ab'], 10 => 'A', 11 => ['A#', 'Bb'], 12 => 'B' }.freeze
Class Method Summary collapse
-
.all(sharp_or_flat = :sharp) ⇒ Object
rubocop:disable Metrics/MethodLength.
- .first ⇒ Object
Class Method Details
.all(sharp_or_flat = :sharp) ⇒ Object
rubocop:disable Metrics/MethodLength
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fretboard/notes.rb', line 24 def self.all(sharp_or_flat = :sharp) # rubocop:disable Metrics/MethodLength BASIS_NOTES.map do |_key, value| result = value if value.is_a?(Array) result = case sharp_or_flat when :both value.join('/') when :sharp value.first else value.last end end result end end |
.first ⇒ Object
43 44 45 |
# File 'lib/fretboard/notes.rb', line 43 def self.first all.first end |