Class: Marmite::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/marmite/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run!Object



5
6
7
# File 'lib/marmite/cli.rb', line 5

def self.run!
  self.new.run!
end

Instance Method Details

#run!Object



9
10
11
12
13
14
15
16
# File 'lib/marmite/cli.rb', line 9

def run!
  say "Use this tool to find out someone's favourite programming language."
  username = ask("Please enter the their GitHub username:")
  user = User.new username
  say("We think they're favourite language is: #{user.favourite_language}")
rescue User::NotFound
  say "Looks like that user doesn't exist in Github."
end