Class: Barker::Quiz
- Inherits:
-
Object
- Object
- Barker::Quiz
- Defined in:
- lib/barker/quiz.rb
Instance Attribute Summary collapse
-
#questions ⇒ Object
readonly
Returns the value of attribute questions.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(questions) ⇒ Quiz
constructor
A new instance of Quiz.
- #valid? ⇒ Boolean
Constructor Details
#initialize(questions) ⇒ Quiz
Returns a new instance of Quiz.
6 7 8 |
# File 'lib/barker/quiz.rb', line 6 def initialize(questions) @questions = questions end |
Instance Attribute Details
#questions ⇒ Object (readonly)
Returns the value of attribute questions.
4 5 6 |
# File 'lib/barker/quiz.rb', line 4 def questions @questions end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/barker/quiz.rb', line 14 def ==(other) questions == other.questions end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/barker/quiz.rb', line 10 def valid? questions.all?(&:valid?) end |