Created
September 23, 2016 17:44
-
-
Save mpelos/1b3f0c14aa6e0a078873ca63a5dfc3d9 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
module Argumentable | |
def self.included(base) | |
base.class_eval do | |
original_initailize = instance_method(:initialize) | |
define_method(:initialize) do |*args, &block| | |
@arguments = args | |
original_initailize.bind(self).call(*args, &block) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment