Skip to content

Instantly share code, notes, and snippets.

@petrachi
Created February 12, 2016 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petrachi/3a55767e7402fcc0f945 to your computer and use it in GitHub Desktop.
Save petrachi/3a55767e7402fcc0f945 to your computer and use it in GitHub Desktop.
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