Created
May 12, 2015 20:18
-
-
Save k-rudy/1f4596fd3029e79b1550 to your computer and use it in GitHub Desktop.
Monkey patching demo
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
require 'redis' | |
class Redis | |
module Connection | |
class Ruby | |
def self.restus | |
puts 'non overriden' | |
end | |
def self.connect(config) | |
puts 'non overriden' | |
end | |
end | |
end | |
end | |
class Redis | |
module Connection | |
class Ruby | |
def self.connect(config) | |
puts 'the method is overriden' | |
end | |
end | |
end | |
end | |
Redis::Connection::Ruby.restus |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment