Class: CLI
- Inherits:
-
Object
- Object
- CLI
- Defined in:
- lib/xkcd_calendar_facts/CLI.rb
Class Method Summary collapse
Class Method Details
.call ⇒ Object
3 4 5 6 7 |
# File 'lib/xkcd_calendar_facts/CLI.rb', line 3 def self.call puts "" puts "------------------XKCD CALENDAR FACTS-------------------" self.start end |
.menu(input) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/xkcd_calendar_facts/CLI.rb', line 19 def self.(input) case input when "\n" FactGenerator.new.print_fact(FACTS) puts "" puts "--Press <ENTER> to learn another interesting calendar fact!" puts "--Enter anything else to exit..." puts "" input = gets self.(input) else puts "--Visit xkcd.com for more!" puts "--Goodbye!" end end |
.start ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/xkcd_calendar_facts/CLI.rb', line 9 def self.start puts "--------------------------------------------------------" puts "--Press <ENTER> to learn an interesting calendar fact!--" puts "--Enter anything else to exit..." input = gets self.(input) end |