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

jquery - Invalid Assignment Left-Hand Side -

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

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -