If and elsif not reconized


#1

print 'Did that guy bother you? ( Y or N or Whatever)'
When I run the code below and put in Y or N it still returns the else part of the loop. What am I missing?

yesorno = gets

if answer == 'Y' or answer == 'y'
print 'Do you want me to slash his tires?'
elsif answer == 'N'
print 'Do you want me to slash his tires and kick him in the shin?'
else
print 'Do you want me to slash his tires and kick him in the shin and put super glue in his locks?'
end


#2

This returns a string WITH a LF ("\n"), as in "y\n". Use chomp to remove it.

yesno = gets.chomp

#3

ah ha. Thank you very much.