Created
February 12, 2016 01:04
-
-
Save petrachi/3a55767e7402fcc0f945 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 DslMethods | |
dsl_method = 'do something' | |
end | |
class DslInject | |
act_as(klass) = klass.dsl_method = DSLMethods.dsl_method | |
end | |
class Something | |
end | |
Somthing.act_as = DslInject.act_as | |
class Something | |
act_as | |
end | |
Something.new.dsl_method #-> 'do something' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment