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 ...
Written by Thomas Riboulet
Related protips
1 Response
Interestingly enough .sum method is only available in ActiveSupport
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#