Created
October 18, 2017 09:29
-
-
Save kstratis/1b86ce96f0e241714894c04ba77ee813 to your computer and use it in GitHub Desktop.
Kernel module methods as Object class methods
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 say_hello | |
puts "hello world" | |
end | |
end | |
Object.new.say_hello # => hello world | |
Object.say_hello # => hello world - Shouldn't be possible! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment