Class: Starter
Constant Summary
Constants included from Commands
Instance Method Summary collapse
- #drills ⇒ Object
-
#initialize ⇒ Starter
constructor
A new instance of Starter.
- #menu(options) ⇒ Object
Methods included from Commands
#back, #clear, #continue, #fail, #fold, #help, #hint, #quit, #review, #skip, #welcome, #win
Constructor Details
#initialize ⇒ Starter
Returns a new instance of Starter.
20 21 22 23 24 25 26 27 |
# File 'lib/starter.rb', line 20 def initialize RubyDrills::Config.pry_config clear welcome (drills) clear quit end |
Instance Method Details
#drills ⇒ Object
49 50 51 |
# File 'lib/starter.rb', line 49 def drills %w[welcome array string hash] end |
#menu(options) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/starter.rb', line 29 def () choice = nil valid_choices = valid_number_to_drill_associations() while (choice != 'q') if valid_choices.include?(choice) clear run_drill([choice.to_i]) elsif (choice == 's') RubyDrills::Config::SESSIONS.stats end puts "\nWhat would you like to learn next?\n\n" .each_with_index {|opt, i| puts "\t#{i}: #{opt.capitalize}"} puts "\n\tq: quit" choice = Readline.readline("\n>> ", true) end end |