Skip to content

Instantly share code, notes, and snippets.

@maxim
Last active December 29, 2015 11:59
Show Gist options
  • Select an option

  • Save maxim/7667073 to your computer and use it in GitHub Desktop.

Select an option

Save maxim/7667073 to your computer and use it in GitHub Desktop.
Use case for refinements
module Barney
refine String do
def wait_for_it(ending)
replace(self + ending)
end
end
end
using Barney
"legen".wait_for_it "dary" # => "legendary"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment