Sha256: 3ed4c799976a72360949d5e708300984452d3719dbec8c9311b35a0329a7d33f

Contents?: true

Size: 463 Bytes

Versions: 14

Compression:

Stored size: 463 Bytes

Contents

# frozen_string_literal: true

module Synvert::Core
  # InsertAfterAction to insert code next to the node.
  class Rewriter::InsertAfterAction < Rewriter::Action
    def calculate_position
      @begin_pos = @node.loc.expression.end_pos
      @end_pos = @begin_pos
    end

    private

    # Indent of the node.
    #
    # @param node [Parser::AST::Node]
    # @return [String] n times whitesphace
    def indent(node)
      ' ' * node.column
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
synvert-core-0.63.1 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.63.0 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.62.1 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.62.0 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.61.2 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.61.1 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.61.0 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.60.0 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.59.0 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.58.3 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.58.2 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.58.0 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.57.1 lib/synvert/core/rewriter/action/insert_after_action.rb
synvert-core-0.57.0 lib/synvert/core/rewriter/action/insert_after_action.rb