Skip to content

Instantly share code, notes, and snippets.

@mpelos
Created September 23, 2016 17:44
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 mpelos/1b3f0c14aa6e0a078873ca63a5dfc3d9 to your computer and use it in GitHub Desktop.
Save mpelos/1b3f0c14aa6e0a078873ca63a5dfc3d9 to your computer and use it in GitHub Desktop.
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