u0_omg
Last Updated: February 25, 2016
·
859
· mcansky
892a174c18182a2a3157e51cd071d1cf

fast comparison

You need to get the smaller of two or more numbers ?

Ruby has a method for that :

[3,7,5].min

Yes it's so simple that you wonder why I write a protip for that. Well if nobody has told you or shown you that, you might not think of it on your own ...

Say Thanks
Respond

1 Response
Add your response

1907
Photo on 08.01.2013 at 04.15

Interestingly enough .sum method is only available in ActiveSupport

over 1 year ago ·