Class: Escape::QuestionList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/escape/question_list.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*questions) ⇒ QuestionList

Returns a new instance of QuestionList.



5
6
7
# File 'lib/escape/question_list.rb', line 5

def initialize(*questions)
  @questions = questions || []
end

Class Method Details

.load(list) ⇒ Object



14
15
16
# File 'lib/escape/question_list.rb', line 14

def load(list)
  new(*list.map { |item| Question.load(item) })
end

Instance Method Details

#each(&block) ⇒ Object



9
10
11
# File 'lib/escape/question_list.rb', line 9

def each(&block)
  questions.each(&block)
end