Ruby warning: string literal in condition -


in seventh line, warning, "string literal in condition". warning mean, , how can resolve it?

   print 'continue use calculator?   y or n'    useragree = gets.chomp    if useragree == 'y' or 'y'         useragree = true    else         useragree = false    end 

change

if useragree == 'y' or 'y' 

to

if useragree == 'y' or useragree == 'y' 

or, cleaner , clearer in opinion:

if useragree.upcase() == 'y' 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -