Class: Coltrane::Commands::FindGuitarChord
- Defined in:
- lib/coltrane/commands/find_guitar_chord.rb
Constant Summary
Constants inherited from Command
Instance Attribute Summary collapse
-
#notation ⇒ Object
readonly
Returns the value of attribute notation.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(notation) ⇒ FindGuitarChord
constructor
A new instance of FindGuitarChord.
- #representation ⇒ Object
Methods inherited from Command
add_shared_option, #custom_guitar, inherited, #render, #renderer_options, subclasses
Constructor Details
#initialize(notation) ⇒ FindGuitarChord
Returns a new instance of FindGuitarChord.
6 7 8 |
# File 'lib/coltrane/commands/find_guitar_chord.rb', line 6 def initialize(notation) @notation = notation end |
Instance Attribute Details
#notation ⇒ Object (readonly)
Returns the value of attribute notation.
4 5 6 |
# File 'lib/coltrane/commands/find_guitar_chord.rb', line 4 def notation @notation end |
Class Method Details
.mercenary_init(program) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/coltrane/commands/find_guitar_chord.rb', line 14 def self.mercenary_init(program) program.command(:'find-guitar-chord') do |c| c.syntax 'find-guitar-chord x-2-2-4-5-x' c.description 'find the chord name assuming the standard tuning (EADGBE)' c.action do |(notation)| new(notation).render end end end |
Instance Method Details
#representation ⇒ Object
10 11 12 |
# File 'lib/coltrane/commands/find_guitar_chord.rb', line 10 def representation Representation::Guitar.find_chord_by_notation(notation) end |