Class: Coltrane::Commands::GetRepresentationChords

Inherits:
Command
  • Object
show all
Defined in:
lib/coltrane/commands/get_representation_chords.rb

Instance Attribute Summary

Attributes inherited from Command

#error

Instance Method Summary collapse

Methods inherited from Command

run

Instance Method Details

#run(representation, chords) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/coltrane/commands/get_representation_chords.rb', line 4

def run(representation, chords)
  chords.map do |chord|
    if representation == 'GuitarChordChart'
      {
        chord.name => Representation::Guitar.find_chords(chord).first(4),
        options: { layout: :horizontal, per_row: 4 }
      }
    else
      { chord.name => GetRepresentationNotes.run(representation, chord.notes) }
    end
  end
end