class WordsAndIdioms::CLI
Public Instance Methods
call()
click to toggle source
# File lib/words_and_idioms/cli.rb, line 3 def call puts "Welcome to Word Explorer!".red greet_user goodbye end
goodbye()
click to toggle source
# File lib/words_and_idioms/cli.rb, line 50 def goodbye puts "I hope you learned something today. See you again soon." end
greet_user()
click to toggle source
# File lib/words_and_idioms/cli.rb, line 9 def greet_user puts "What would you like to do?" puts " " puts "1. Retrieve a word's definition from Dictionary.com." puts "OR" puts "2. See a list of current idiomatic expressions from MacMillan's Open Dictionary." puts "OR" puts "3. EXIT" puts " " menu end
print_idiom_list()
click to toggle source
# File lib/words_and_idioms/cli.rb, line 21 def print_idiom_list puts "Below is a list of newly created idioms from MacMillan's Open Dictionary Project" Idiom.all.each.with_index(1) do |idiom, i| puts "#{i}. #{idiom.name}" end IdiomExplorer.show_idiom end