Last active
August 29, 2015 14:22
-
-
Save michael-reeves/a4cb85116cd032f60df5 to your computer and use it in GitHub Desktop.
Exploring self
This file contains hidden or 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
puts "Top Level" | |
puts "self is #{self}" | |
class C | |
puts "Class definition block:" | |
puts "self is #{self}" | |
def self.x | |
puts "Class method C.x:" | |
puts "self is #{self}" | |
end | |
def m | |
puts "Instance method C#m" | |
puts "self is #{self}" | |
end | |
end | |
C.x | |
C.new.m | |
class D < C | |
end | |
D.x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment