Created
November 30, 2011 02:52
-
-
Save cgriego/1407770 to your computer and use it in GitHub Desktop.
EvilObject
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 EvilObject | |
class << self | |
def const_defined?(*) | |
true | |
end | |
def const_get(*) | |
Object | |
end | |
def include?(*) | |
true | |
end | |
def method_defined?(*) | |
true | |
end | |
def name | |
"Object" | |
end | |
def superclass | |
nil | |
end | |
def ancestors | |
[] | |
end | |
end | |
def class | |
Object | |
end | |
def nil? | |
true | |
end | |
def <=>(other) | |
0 | |
end | |
def clone | |
self | |
end | |
alias_method :dup, :clone | |
def hash | |
1 | |
end | |
alias_method :object_id, :hash | |
def send(*) | |
end | |
def is_a?(*) | |
true | |
end | |
alias_method :kind_of?, :is_a? | |
def tap | |
end | |
def respond_to?(*) | |
true | |
end | |
def method(*) | |
super(:object_id) | |
end | |
def method_missing(*) | |
end | |
def to_s | |
1 | |
end | |
def to_i | |
"i" | |
end | |
def to_enum | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment