Using Ruby’s each_with_object
Sometimes we’d like to build a new collection object from the elements of another collection. One trivial example would be element occurrence counting, whic...
Sometimes we’d like to build a new collection object from the elements of another collection. One trivial example would be element occurrence counting, whic...
Some Rubyists, when faced with the task of matching against the beginning or the end of a string, are prone to using ^ and $ in their regular expressions. Mo...
Good news, everyone - RuboCop 0.14 was just released!
Recently we discussed how you can use String#gsub with a block. Today we’ll examine another somewhat unknown feature of the gsub method - the ability to supp...
There are whopping 4 ways to invoke a lambda (or a proc) in Ruby: