Skip to content

Instantly share code, notes, and snippets.

@ileitch
Created February 18, 2012 19:14
Show Gist options
  • Select an option

  • Save ileitch/1860696 to your computer and use it in GitHub Desktop.

Select an option

Save ileitch/1860696 to your computer and use it in GitHub Desktop.
=> class Foo
=> p = Proc.new {}
=> define_method :a, p
=> define_method :b, p
=> end
=>
=> foo = Foo.new
=> foo.method(:a)
[]
=> foo.method(:b)
[]
diff --git a/kernel/common/method.rb b/kernel/common/method.rb
index 1ae6585..c27d53d 100644
--- a/kernel/common/method.rb
+++ b/kernel/common/method.rb
@@ -19,6 +19,9 @@ class Method
# Module that the method is defined in.
def initialize(receiver, defined_in, executable, name)
+ if executable.kind_of?(Rubinius::BlockEnvironment::AsMethod)
+ p executable.instance_variable_get("@block_env").instance_variables
+ end
@receiver = receiver
@defined_in = defined_in
@executable = executable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment