Class: Synvert::Rewriter::InsertAfterAction

Inherits:
Action
  • Object
show all
Defined in:
lib/synvert/rewriter/action.rb

Overview

InsertAfterAction to insert code next to the node.

Instance Method Summary collapse

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_posInteger

Begin position to insert code.

Returns:

  • (Integer)

    begin position.



177
178
179
# File 'lib/synvert/rewriter/action.rb', line 177

def begin_pos
  @node.loc.expression.end_pos
end

#end_posInteger

End position, always same to begin position.

Returns:

  • (Integer)

    end position.



184
185
186
# File 'lib/synvert/rewriter/action.rb', line 184

def end_pos
  begin_pos
end