Created
September 30, 2013 22:08
-
-
Save phiggins/6771033 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 Kernel | |
def method_a | |
:foo | |
end | |
end | |
def method_b | |
:bar | |
end | |
p a: method_a, b: method_b | |
puts | |
p a: method(:method_a).owner, b: method(:method_b).owner | |
puts | |
p a: method(:method_a).owner.ancestors, b: method(:method_b).owner.ancestors |
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
pete@balloon:~/projects$ ruby -v defs.rb | |
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux] | |
{:a=>:foo, :b=>:bar} | |
{:a=>Kernel, :b=>Object} | |
{:a=>[Kernel], :b=>[Object, Kernel, BasicObject]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment