Class: ArticleFixtureGen::Data::ReplaceChildNodesUsingNewChild

Inherits:
Object
  • Object
show all
Defined in:
lib/article_fixture_gen/data/replace_child_nodes_using_new_child.rb

Overview

Replaces the (INTERNAL!) list of child nodes of an element with a list generated elsewhere (that replaces a single text node with two text nodes separated by a new element).

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(parent_node, target_entry, new_el) ⇒ Object



12
13
14
# File 'lib/article_fixture_gen/data/replace_child_nodes_using_new_child.rb', line 12

def self.call(parent_node, target_entry, new_el)
  new(parent_node, target_entry, new_el).call
end

Instance Method Details

#callObject



16
17
18
# File 'lib/article_fixture_gen/data/replace_child_nodes_using_new_child.rb', line 16

def call
  element.instance_variable_set :@nodes, nodes
end