Created
October 2, 2013 17:00
-
-
Save misfo/6796883 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
def self.some_func | |
end | |
# now we can call this at the top-level | |
p some_func #=> nil | |
# without polluting Object | |
p Object.new.respond_to?(:some_func, true) #=> false | |
def some_object_polluting_func | |
end | |
# that also makes the method available at the top-level | |
p some_object_polluting_func #=> nil | |
# but it pollutes Object | |
p Object.new.respond_to?(:some_object_polluting_func, true) #=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment