Class: Barker::CandidateRound
- Inherits:
-
Object
- Object
- Barker::CandidateRound
- Defined in:
- lib/barker/candidate_round.rb
Instance Attribute Summary collapse
-
#candidate ⇒ Object
readonly
Returns the value of attribute candidate.
-
#guideline ⇒ Object
readonly
Returns the value of attribute guideline.
-
#round ⇒ Object
readonly
Returns the value of attribute round.
-
#timer ⇒ Object
readonly
Returns the value of attribute timer.
Instance Method Summary collapse
- #answer(answer_id) ⇒ Object
- #ask(options = {}) ⇒ Object
- #given_answer ⇒ Object
-
#initialize(candidate, round, options = {}) ⇒ CandidateRound
constructor
A new instance of CandidateRound.
- #joker(joker) ⇒ Object
- #question ⇒ Object
Constructor Details
#initialize(candidate, round, options = {}) ⇒ CandidateRound
Returns a new instance of CandidateRound.
5 6 7 8 9 10 |
# File 'lib/barker/candidate_round.rb', line 5 def initialize(candidate, round, = {}) @candidate = candidate @round = round @guideline = [:guideline] @timer = guideline.try(:round_time) end |
Instance Attribute Details
#candidate ⇒ Object (readonly)
Returns the value of attribute candidate.
3 4 5 |
# File 'lib/barker/candidate_round.rb', line 3 def candidate @candidate end |
#guideline ⇒ Object (readonly)
Returns the value of attribute guideline.
3 4 5 |
# File 'lib/barker/candidate_round.rb', line 3 def guideline @guideline end |
#round ⇒ Object (readonly)
Returns the value of attribute round.
3 4 5 |
# File 'lib/barker/candidate_round.rb', line 3 def round @round end |
#timer ⇒ Object (readonly)
Returns the value of attribute timer.
3 4 5 |
# File 'lib/barker/candidate_round.rb', line 3 def timer @timer end |
Instance Method Details
#answer(answer_id) ⇒ Object
20 21 22 |
# File 'lib/barker/candidate_round.rb', line 20 def answer(answer_id) question.answer(answer_id) end |
#ask(options = {}) ⇒ Object
16 17 18 |
# File 'lib/barker/candidate_round.rb', line 16 def ask( = {}) question.ask() end |
#given_answer ⇒ Object
24 25 26 |
# File 'lib/barker/candidate_round.rb', line 24 def given_answer question.given_answer end |
#joker(joker) ⇒ Object
28 29 30 |
# File 'lib/barker/candidate_round.rb', line 28 def joker(joker) question.joker(joker) end |
#question ⇒ Object
12 13 14 |
# File 'lib/barker/candidate_round.rb', line 12 def question @question ||= CandidateQuestion.new(candidate, round.question, :timer => timer) end |