Class: Coltrane::Commands::GetChordsFromString

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

Instance Attribute Summary

Attributes inherited from Command

#error

Instance Method Summary collapse

Methods inherited from Command

run

Instance Method Details

#run(string) ⇒ Object



4
5
6
7
8
# File 'lib/coltrane/commands/get_chords_from_string.rb', line 4

def run(string)
  string.split(' ').map do |chord|
    Theory::Chord.new(name: chord)
  end
end