Created
March 29, 2015 13:51
-
-
Save mrkplt/c86a8a5c7450d79d5ebb 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 BadDemeter | |
# this is an example that abuses LoD. I am not saying that your code | |
# can't look like this for other reasons. | |
def thinger | |
useless_abstraction_three.last | |
end | |
private | |
def useless_abstraction_one | |
some_array.map(&:foo) | |
end | |
def useless_abstraction_two | |
useless_abstraction_one.map(&:bar) | |
end | |
def useless_abstraction_three | |
useless_abstraction_one.select(&:baz) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment