Skip to content

Commit

Permalink
Extract Decorator Step Seven
Browse files Browse the repository at this point in the history
* Inline method
  • Loading branch information
jferris committed Feb 22, 2013
1 parent 876ec97 commit 77b22c5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions example_app/app/models/unanswered_question_hider.rb
Expand Up @@ -8,18 +8,14 @@ def initialize(summarizer, user)

def summarize(question)
if hide_unanswered_question?(question)
hide_answer_to_question(question)
NO_ANSWER
else
@summarizer.summarize(question)
end
end

private

def hide_answer_to_question(question)
NO_ANSWER
end

def hide_unanswered_question?(question)
@user && !question.answered_by?(@user)
end
Expand Down

0 comments on commit 77b22c5

Please sign in to comment.