Ruby 2.4 adds Comparable#clamp method
In Ruby 2.4, clamp method is added to the Comparable module. This method can be used to clamp an object within a specific range of values.
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
In Ruby 2.4, clamp method is added to the Comparable module. This method can be used to clamp an object within a specific range of values.
Post a comment