Class: Kitchen::Directions::AnswerKeyInnerContainer::V1

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/directions/move_solutions_to_answer_key/answer_key_inner_container.rb

Instance Method Summary collapse

Instance Method Details

#bake(chapter:, metadata_source:, append_to:, solutions_plural:) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/kitchen/directions/move_solutions_to_answer_key/answer_key_inner_container.rb', line 16

def bake(chapter:, metadata_source:, append_to:, solutions_plural:)
  @solutions_or_solution = solutions_plural ? 'solutions' : 'solution'
  @uuid_key = "#{@solutions_or_solution}#{chapter.count_in(:book)}"
  @metadata = .children_to_keep.copy
  @composite_element = 'composite-page'
  @title = "#{I18n.t(:chapter)} #{chapter.count_in(:book)}"
  @main_title_tag = 'h2'

  append_to.append(
    child: render(file: '../book_answer_key_container/eob_answer_key_container.xhtml.erb')
  ).first("div[data-uuid-key='.#{@uuid_key}']")
end