0

Case

Can a case function take an expression such as string.include?() == true

5th May 2020, 2:24 AM
Jordan Howlett
Jordan Howlett - avatar
1 Respuesta
+ 2
According to http://ruby-doc.com/docs/ProgrammingRuby/html/tut_expressions.html#S5 Switch structures in Ruby are basically "multiway ifs on steriods", and doesn't mention restrictions on switching certain data types. I'd expect it to work and surely, case "bygone".include?"by" when true puts "yes" when false puts "no" end works fine.
5th May 2020, 2:55 AM
Hatsy Rei
Hatsy Rei - avatar