Tried the exercise of "unless", it worked fine. But, I am confused on how to use a boolean here.
print "Are you hungry?? Say yes or no"
hungry = gets.chomp
unless hungry == yes
puts "I'm writing Ruby programs!"
puts "Time to eat!"
It will work if the yes is inside a "" that is string. My doubt is that, here yes/no is not string. but a boolean.
How to define a boolean here?
I learned if its integer, its will be like
eg : number = Integer(gets.chomp).
Please help me to learn how to use boolean like above?
Are you hungry?? Say yes or no no
undefined local variable or method `yes' for #