Class: Wizardry::Pages::CheckYourAnswersPage

Inherits:
Page
  • Object
show all
Defined in:
lib/wizardry/pages/check_your_answers_page.rb

Instance Attribute Summary collapse

Attributes inherited from Page

#pages

Instance Method Summary collapse

Methods inherited from Page

#after_update!, #before_edit!, #before_update!, #branch!, #branch?, #next_pages

Constructor Details

#initialize(questions: [], title: 'Check your answers') ⇒ CheckYourAnswersPage

Returns a new instance of CheckYourAnswersPage.



6
7
8
9
10
11
# File 'lib/wizardry/pages/check_your_answers_page.rb', line 6

def initialize(questions: [], title: 'Check your answers')
  @title     = title
  @questions = questions

  super(pages: [])
end

Instance Attribute Details

#questionsObject (readonly)

Returns the value of attribute questions.



4
5
6
# File 'lib/wizardry/pages/check_your_answers_page.rb', line 4

def questions
  @questions
end

#titleObject (readonly)

Returns the value of attribute title.



4
5
6
# File 'lib/wizardry/pages/check_your_answers_page.rb', line 4

def title
  @title
end

Instance Method Details

#nameObject



13
14
15
# File 'lib/wizardry/pages/check_your_answers_page.rb', line 13

def name
  :check_your_answers
end

#question_namesObject



17
18
19
# File 'lib/wizardry/pages/check_your_answers_page.rb', line 17

def question_names
  @questions.map(&:name)
end