Sha256: 0b1d468724438b7074d60701160817e55ab3d9fa1673795a43cbc679e4aae36a
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true module Kitchen::Directions::BakeChapterAnswerKey class V1 def bake(chapter:, metadata_source:, strategy:, append_to:) strategy = case strategy when :calculus Strategies::Calculus when :uphysics Strategies::UPhysics else raise 'No such strategy' end append_to.append(child: <<~HTML <div class="os-eob os-solutions-container" data-type="composite-page" data-uuid-key=".solutions#{chapter.count_in(:book)}"> <h2 data-type="document-title"> <span class="os-text">#{I18n.t(:chapter)} #{chapter.count_in(:book)}</span> </h2> <div data-type="metadata" style="display: none;"> <h1 data-type="document-title" itemprop="name">#{I18n.t(:chapter)} #{chapter.count_in(:book)}</h1> #{metadata_source.children_to_keep.copy.paste} </div> </div> HTML ) strategy.new.bake(chapter: chapter, append_to: append_to.last_element) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
openstax_kitchen-3.2.0 | lib/kitchen/directions/bake_chapter_answer_key/v1.rb |
openstax_kitchen-3.1.0 | lib/kitchen/directions/bake_chapter_answer_key/v1.rb |