Skip to content

Instantly share code, notes, and snippets.

@pedrozath
Created October 16, 2018 13:31
Show Gist options
  • Save pedrozath/c8fb677b452a8aeb11cdd6aab39bf4e7 to your computer and use it in GitHub Desktop.
Save pedrozath/c8fb677b452a8aeb11cdd6aab39bf4e7 to your computer and use it in GitHub Desktop.
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