Sha256: ae260a5fdef7da51594cfa4edbb77f51df689ddaf1c890dc09a144aad894492c
Contents?: true
Size: 792 Bytes
Versions: 8
Compression:
Stored size: 792 Bytes
Contents
# frozen_string_literal: true module Kitchen::Directions::MoveSolutionsToAnswerKey module Strategies class Default def bake(chapter:, append_to:) bake_section(chapter: chapter, append_to: append_to) end protected def bake_section(chapter:, append_to:) @selectors.each do |selector| chapter.search("#{selector} div[data-type='solution']").each do |solution| append_to.append(child: solution.cut.to_s) end end end # This method helps to obtain more strategy-specific params through # "strategy_options: {blah1: 1, blah2: 2}" def initialize(strategy_options) @selectors = strategy_options[:selectors] || (raise 'missing selectors for strategy') end end end end
Version data entries
8 entries across 8 versions & 1 rubygems