Determining if a variable is within range?
if i.between?(1, 10) do thing 1 elsif i.between?(11,20) do thing 2 ...
As @Baldu said, use the === operator or use case/when which internally uses === :
case iwhen 1..10 # do thing 1when 11..20 # do thing 2when 21..30 # do thing 3etc...