Skip to content

Instantly share code, notes, and snippets.

@gmanley
Created February 25, 2013 20:26
Show Gist options
  • Save gmanley/5032988 to your computer and use it in GitHub Desktop.
Save gmanley/5032988 to your computer and use it in GitHub Desktop.
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