Class: Kitchen::Directions::AnswerKeyCleaner::V1

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

Instance Method Summary collapse

Instance Method Details

#bake(book:) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/kitchen/directions/move_solutions_to_answer_key/answer_key_cleaner.rb', line 11

def bake(book:)
  answer_key_chapters = book.search(
    '.os-eob[data-type="composite-chapter"] > [data-type="composite-page"]')
  answer_key_chapters.each do |container|
    container.trash unless container.contains?('[data-type="solution"]')
  end
end