Class: NodeMutation::ReplaceAction
- Defined in:
- lib/node_mutation/action/replace_action.rb
Overview
ReplaceAction to replace child node with code.
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
-
#initialize(node, *selectors, adapter:, with:) ⇒ ReplaceAction
constructor
Initailize a ReplaceAction.
-
#new_code ⇒ String
The rewritten source code.
Methods inherited from Action
Constructor Details
#initialize(node, *selectors, adapter:, with:) ⇒ ReplaceAction
Initailize a ReplaceAction.
11 12 13 14 15 |
# File 'lib/node_mutation/action/replace_action.rb', line 11 def initialize(node, *selectors, adapter:, with:) super(node, with, adapter: adapter) @selectors = selectors @type = :replace end |
Instance Method Details
#new_code ⇒ String
The rewritten source code.
20 21 22 |
# File 'lib/node_mutation/action/replace_action.rb', line 20 def new_code rewritten_source end |