Sha256: 780c545c3ac8216d6ea2663f55e6cb1665b0641614621938e367f02148e79307

Contents?: true

Size: 618 Bytes

Versions: 3

Compression:

Stored size: 618 Bytes

Contents

module Coltrane
  module Commands
    class FindGuitarChord < Command
      attr_reader :notation

      def initialize(notation)
        @notation = notation
      end

      def representation
        Representation::Guitar.find_chord_by_notation(notation)
      end

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coltrane-3.4.2 lib/coltrane/commands/find_guitar_chord.rb
coltrane-3.4.1 lib/coltrane/commands/find_guitar_chord.rb
coltrane-3.4.0 lib/coltrane/commands/find_guitar_chord.rb