Sha256: eba685ff07c24493a3389b080bd5b88329c4dd4a4dfa31f952e607a7b9f2eabb

Contents?: true

Size: 538 Bytes

Versions: 3

Compression:

Stored size: 538 Bytes

Contents

module Coltrane
  module UI
    module Views
      class ShowChord < View
        questions({
          chord: { statement: 'Which chord?' },
          chord_representation: {
            statement: 'How do you wanna see it?',
            options: Commands::AvailableChordRepresentations.run
          }
        })

        def render
          chord = Commands::GetChordsFromString.run(params[:chord]).first
          Commands::GetRepresentationChords.run(params[:chord_representation], [chord])
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coltrane-4.0.5 lib/coltrane/ui/views/show_chord.rb
coltrane-4.0.4 lib/coltrane/ui/views/show_chord.rb
coltrane-4.0.3 lib/coltrane/ui/views/show_chord.rb