Created
May 18, 2016 09:43
-
-
Save flash-gordon/3378dc8188fe19592584e89c84efc3a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
module Imprint | |
Import = Dry::AutoInject(Container) | |
KwargsImport = Import.kwargs | |
class << self | |
def inject(target) | |
-> *values { target.send(:include, KwargsImport[*values]) } | |
end | |
def args_inject(target) | |
-> *values { target.send(:include, Import[*values]) } | |
end | |
end | |
module Mixin | |
def container | |
Imprint::Container | |
end | |
def inject | |
Imprint.inject(self) | |
end | |
def args_inject | |
Imprint.args_inject(self) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment