Class: Synvert::Core::Rewriter::AppendAction
- Defined in:
- lib/synvert/core/rewriter/action/append_action.rb
Overview
AppendWithAction to append code to the bottom of node body.
Instance Method Summary collapse
-
#begin_pos ⇒ Integer
Begin position to append code.
-
#end_pos ⇒ Integer
End position, always same to begin position.
Methods inherited from Action
#<=>, #initialize, #line, #rewritten_code, #rewritten_source
Constructor Details
This class inherits a constructor from Synvert::Core::Rewriter::Action
Instance Method Details
#begin_pos ⇒ Integer
Begin position to append code.
9 10 11 12 13 14 15 |
# File 'lib/synvert/core/rewriter/action/append_action.rb', line 9 def begin_pos if :begin == @node.type @node.loc.expression.end_pos else @node.loc.expression.end_pos - @node.indent - 4 end end |
#end_pos ⇒ Integer
End position, always same to begin position.
20 21 22 |
# File 'lib/synvert/core/rewriter/action/append_action.rb', line 20 def end_pos begin_pos end |