Created
February 4, 2010 00:28
-
-
Save gabrielg/294228 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
class Tricksy | |
def self.lulz | |
puts "denied" | |
end | |
def self.singleton_method_added(name) | |
Object.const_set(:Tricksy, RealTricksy) if defined?(RealTricksy) | |
end | |
RealTricksy = self.clone | |
end | |
task :default do | |
load "lib/tricksy.rb" | |
Tricksy.lulz | |
SuperTricksy.lulz | |
end |
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
class Tricksy | |
def self.lulz | |
puts "lulz" | |
end | |
end | |
class SuperTricksy | |
def self.lulz | |
puts "super lulz" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment