Sha256: d00c5cb05d98fe3d4c3e40837370cce8b7bfeae89ea4b1d30f630e4cf2c3d5e7
Contents?: true
Size: 1012 Bytes
Versions: 13
Compression:
Stored size: 1012 Bytes
Contents
# frozen_string_literal: true module Kitchen::Directions::MoveSolutionsFromExerciseSection def self.v1(chapter:, append_to:, section_class:, title_number: nil) V1.new.bake(chapter: chapter, append_to: append_to, section_class: section_class, title_number: title_number) end class V1 def bake(chapter:, append_to:, section_class:, title_number:) solutions_clipboard = chapter.search("section.#{section_class}").solutions.cut return if solutions_clipboard.items.empty? title_text = \ if title_number I18n.t(:"eoc.#{section_class}", number: title_number) else I18n.t(:"eoc.#{section_class}") end title = <<~HTML <h3 data-type="title"> <span class="os-title-label">#{title_text}</span> </h3> HTML append_to.append(child: Kitchen::Directions::SolutionAreaSnippet.v1( title: title, solutions_clipboard: solutions_clipboard ) ) end end end
Version data entries
13 entries across 13 versions & 1 rubygems