-
-
Save enebo/ade39f1dbad8c8d30a56522519d9afd6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClassWithFoo | |
def foo; "foo" end | |
end | |
module PrependedModule | |
def foo; "foo from prepended module"; end | |
end | |
module IncludedModule | |
def foo; "foo from included module"; end | |
end | |
class Refined < ClassWithFoo | |
end | |
module Refinement | |
refine Refined do | |
include IncludedModule | |
prepend PrependedModule | |
def foo; "foo from refinement"; end | |
end | |
end | |
module DoIt | |
using Refinement | |
p Refined.new.foo | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment