Created
February 25, 2013 20:26
-
-
Save gmanley/5032988 to your computer and use it in GitHub Desktop.
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
class Person | |
# extend and include go first | |
extend SomeModule | |
include AnotherModule | |
# constants are next | |
SOME_CONSTANT = 20 | |
# afterwards we have attribute macros | |
attr_reader :name | |
# followed by other macros (if any) | |
validates :name | |
# public class methods are next in line | |
def self.some_method | |
end | |
# followed by public instance methods | |
def some_method | |
end | |
# protected and private methods are grouped near the end | |
protected | |
def some_protected_method | |
end | |
private | |
def some_private_method | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment