Sha256: 44cca5b32a66a5a706c835c8a76a85ec1cfdecda5cf9a92e39e95d23ac1d4cc1
Contents?: true
Size: 507 Bytes
Versions: 6
Compression:
Stored size: 507 Bytes
Contents
# frozen_string_literal: true module Bemer class CommonTemplate attr_reader :mode def initialize(mode) @mode = mode.to_s.sub('add_', '').to_sym end def apply!(node) case mode when Pipeline::REPLACE_MODE then replace!(node) when Pipeline::CONTENT_MODE then node.add_child_nodes else node.public_send(mode) end end protected def replace!(node) node.need_replace = true node.replacers << node.dup nil end end end
Version data entries
6 entries across 6 versions & 1 rubygems