Instantly share code, notes, and snippets.

Embed
What would you like to do?
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