class Synvert::Core::Rewriter::InsertAfterAction

InsertAfterAction to insert code next to the node.

Public Instance Methods

begin_pos() click to toggle source

Begin position to insert code.

@return [Integer] begin position.

# File lib/synvert/core/rewriter/action/insert_after_action.rb, line 9
def begin_pos
  @node.loc.expression.end_pos
end
end_pos() click to toggle source

End position, always same to begin position.

@return [Integer] end position.

# File lib/synvert/core/rewriter/action/insert_after_action.rb, line 16
def end_pos
  begin_pos
end

Private Instance Methods

indent(node) click to toggle source

Indent of the node.

@param node [Parser::AST::Node] @return [String] n times whitesphace

# File lib/synvert/core/rewriter/action/insert_after_action.rb, line 26
def indent(node)
  ' ' * node.column
end