Created
October 16, 2018 13:31
-
-
Save pedrozath/c8fb677b452a8aeb11cdd6aab39bf4e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Coltrane | |
module UI | |
module Views | |
class ShowScale < View | |
questions({ | |
scale: { | |
statement: 'Which Scale?', | |
options: Commands::AvailableClassicScales.run | |
}, | |
tone: { statement: 'What is the root of the scale?' }, | |
representation: { | |
statement: 'How to display?', | |
options: Commands::AvailableRepresentations.run | |
} | |
}) | |
def render | |
scale = Commands::GetClassicScale.run(*params.values_at(:scale, :tone)) | |
Commands::GetRepresentationNotes.run(params[:representation], scale.notes) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment