Created
April 16, 2010 17:39
-
-
Save jfontan/368712 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
# Fix for ruby 1.8.5 | |
def Object.class_variable_defined?(var) | |
Object.class_variables.include?(var.to_s) | |
end unless Object.respond_to? :class_variable_defined? | |
class Object | |
def instance_variable_defined?(var) | |
self.instance_variables.include?(var.to_s) | |
end unless Object.new.respond_to? :instance_variable_defined? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment