Created
May 30, 2012 11:38
-
-
Save brainopia/2835713 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
module A | |
# prefer when there are less than three class methods | |
# and there are instance methods | |
def self.boo | |
end | |
def self.soo | |
end | |
def fuuu | |
end | |
end | |
module B | |
# prefer when there are three or more class methods | |
# and there are instance methods | |
class << self | |
def boo | |
end | |
def soo | |
end | |
def moo | |
end | |
end | |
def fuuu | |
end | |
end | |
module C | |
# prefer when there are no private/protected | |
# and there are no instance methods | |
module_function | |
def boo | |
end | |
def moo | |
end | |
end | |
module D | |
# prefer when there are private/protected scopes | |
# and there are no instance methods | |
extend self | |
def boo | |
end | |
private | |
def moo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment