Class: Synvert::Core::Rewriter::RemoveAction
- Defined in:
- lib/synvert/core/rewriter/action/remove_action.rb
Overview
RemoveAction to remove current node.
Constant Summary
Constants inherited from Action
Instance Method Summary collapse
-
#begin_pos ⇒ Integer
Begin position of code to replace.
-
#end_pos ⇒ Integer
End position of code to replace.
-
#initialize(instance) ⇒ RemoveAction
constructor
A new instance of RemoveAction.
-
#rewritten_code ⇒ Object
The rewritten code, always empty string.
Methods inherited from Action
Constructor Details
#initialize(instance) ⇒ RemoveAction
Returns a new instance of RemoveAction.
6 7 8 |
# File 'lib/synvert/core/rewriter/action/remove_action.rb', line 6 def initialize(instance) super(instance, nil) end |
Instance Method Details
#begin_pos ⇒ Integer
Begin position of code to replace.
13 14 15 16 17 18 19 |
# File 'lib/synvert/core/rewriter/action/remove_action.rb', line 13 def begin_pos if take_whole_line? start_index else @node.loc.expression.begin_pos end end |
#end_pos ⇒ Integer
End position of code to replace.
24 25 26 27 28 29 30 |
# File 'lib/synvert/core/rewriter/action/remove_action.rb', line 24 def end_pos if take_whole_line? end_index else @node.loc.expression.end_pos end end |
#rewritten_code ⇒ Object
The rewritten code, always empty string.
33 34 35 |
# File 'lib/synvert/core/rewriter/action/remove_action.rb', line 33 def rewritten_code '' end |