Class: Barker::Jokers::FiftyFifty

Inherits:
Object
  • Object
show all
Defined in:
lib/barker/joker.rb

Class Method Summary collapse

Class Method Details

.call(candidate_question) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/barker/joker.rb', line 22

def self.call(candidate_question)
  amount = candidate_question.answers.size / 2
  wrong_answers = candidate_question.answers.reject {|a| a.correct? }

  amount.times do |i|
    wrong_answers[i].try(:reveal)
  end
end