Skip to content

Instantly share code, notes, and snippets.

@levicole
Created September 16, 2009 00:07
Show Gist options
  • Select an option

  • Save levicole/187765 to your computer and use it in GitHub Desktop.

Select an option

Save levicole/187765 to your computer and use it in GitHub Desktop.
def get_input
print ">>"
STDOUT.flush
response = STDIN.gets.chomp
case response
when "exit"
puts "bye!"
@running = false
when "time"
puts "The Time is:#{Time.now}"
end
end
@running = true
while @running == true
get_input
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment