ruby - How to check if a value is included between two other values? -
i'm trying express condition this:
if 33.75 < degree <= 56.25 # code end
but ruby gives error:
undefined method `<=' true:trueclass
i'm guessing 1 way like:
if 33.75 < degree , degree <= 56.25 # code end
but there no another, easier way?
ruby has between?:
if value.between?(lower, higher)
Comments
Post a Comment