This code works as expected:
if phrase.last.eql? "?" ? true : false true else false end but this code using the Ruby ternary operator:
phrase.last.eql? "?" ? true : false gives the following error:
warning: string literal in condition
Do I need to escape the "?" somehow?
puts "#{5 == 5.0}, #{5.eql?(5.0)}, #{5.equal?(5.0)}" # => true false false.truebecause the values are the same,false #1because the values are different types, even though they are (=) equal,false #2because the values have differentobject_id's.