Created
May 13, 2010 07:41
-
-
Save reinh/399603 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 Foo | |
# an instance method, added to Foo's method table (added to Foo) | |
def foo | |
end | |
# a class method, added to Foo's singleton class (because only classes can | |
# store methods, so a class method must be a method on "the class's class") | |
def Foo.foo | |
end | |
# a class method, added to self's singleton class (in this case, self is Foo: | |
# self could also be a subclass) | |
def self.foo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment