Skip to content

Instantly share code, notes, and snippets.

@vanmichael
Created November 24, 2013 18:20
Show Gist options
  • Select an option

  • Save vanmichael/7630424 to your computer and use it in GitHub Desktop.

Select an option

Save vanmichael/7630424 to your computer and use it in GitHub Desktop.
Phase 2
#Echo Phase 2
class Echo
def initialize
get_input
if @input == "Nothing!"
puts "Ok, fine!"
elsif @input == "I have a lot to say"
puts "I don't have time for that right now!"
else
play_back(@input)
end
end
def get_input
puts "What do you want to say?"
@input = gets.chomp
end
def play_back(response)
puts "You said: #{response}"
end
end
Echo.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment