Skip to content

Instantly share code, notes, and snippets.

@LTe
Created January 31, 2012 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save LTe/1710563 to your computer and use it in GitHub Desktop.
Save LTe/1710563 to your computer and use it in GitHub Desktop.
module M
def method
puts "hello"
end
end
def execute(current_module, &block)
Object.new.tap do |o|
o.extend(current_module)
o.instance_eval &block
end
end
execute(M) do
method
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment