Created
September 16, 2011 03:22
-
-
Save havenwood/1221128 to your computer and use it in GitHub Desktop.
self.something
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
def self.something | |
:red | |
end | |
something #=> :red | |
defined? something #=> "method" | |
something = :blue # then local variable hijacks something, oh noes | |
something #=> :blue | |
defined? something #=> "local-variable" | |
self.something #=> :red # method still here though | |
defined? self.something #=> "method" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment