Class: Synvert::Core::Rewriter::InsertAction
- Defined in:
- lib/synvert/core/rewriter/action/insert_action.rb
Overview
AddAction to add code to the node.
Constant Summary
Constants inherited from Action
Action::DEFAULT_INDENT, Action::DEFAULT_OPTIONS
Instance Method Summary collapse
-
#begin_pos ⇒ Integer
Begin position to insert code.
-
#end_pos ⇒ Integer
End position, always same to begin position.
-
#rewritten_code ⇒ String
The rewritten source code.
Methods inherited from Action
#initialize, #line, #rewritten_source
Constructor Details
This class inherits a constructor from Synvert::Core::Rewriter::Action
Instance Method Details
#begin_pos ⇒ Integer
Begin position to insert code.
9 10 11 |
# File 'lib/synvert/core/rewriter/action/insert_action.rb', line 9 def begin_pos @node.loc.expression.end_pos end |
#end_pos ⇒ Integer
End position, always same to begin position.
16 17 18 |
# File 'lib/synvert/core/rewriter/action/insert_action.rb', line 16 def end_pos begin_pos end |
#rewritten_code ⇒ String
The rewritten source code.
23 24 25 |
# File 'lib/synvert/core/rewriter/action/insert_action.rb', line 23 def rewritten_code rewritten_source end |