Add curried version of `twice` in Ruby