Class: Synvert::Rewriter::AppendAction
- Defined in:
- lib/synvert/rewriter/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::Rewriter::Action
Instance Method Details
#begin_pos ⇒ Integer
Begin position to append code.
97 98 99 100 101 102 103 |
# File 'lib/synvert/rewriter/action.rb', line 97 def begin_pos if :begin == @node.type @node.loc.expression.end_pos else @node.loc.expression.end_pos - 4 end end |
#end_pos ⇒ Integer
End position, always same to begin position.
108 109 110 |
# File 'lib/synvert/rewriter/action.rb', line 108 def end_pos begin_pos end |