Skip to content

Instantly share code, notes, and snippets.

@ngtk
Created November 4, 2015 03:34
Show Gist options
  • Select an option

  • Save ngtk/fec38aa71e98cb74a8e5 to your computer and use it in GitHub Desktop.

Select an option

Save ngtk/fec38aa71e98cb74a8e5 to your computer and use it in GitHub Desktop.
refinements pattern
class Human
def say
puts "hello"
end
end
module PartyPeople
refine Human do
def say
puts "hooooo!!!"
end
end
end
module AnyModule
using PartyPeople
bob = Human.new
puts "bob:"
bob.say
end
alice = Human.new
puts "alice:"
alice.say
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment