Guest User

Untitled

a guest
Feb 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. module Enumerable
  2. def _(method, *args, &block)
  3. respond_to?(method) ? send(method, *args, &block) : first.send(method, *args, &block)
  4. end
  5. end
  6.  
  7. puts ['ok', 'asdf']._(:gsub, 'ok', 'good') # => 'good
Add Comment
Please, Sign In to add comment