Just discovered this today, does it even need an explanation for why it's cool?

4.between?(1,5) => true
4.between?(5,10) => false
No more code that looks like:
if value > 1 and value < 5
 yadda yadda
end
It'll simply be written like so:
if value.between?(1,5)
 yadda yadda
end 


Published

2010-08-24

Categories


Tags