Sha256: 407077d57a026411c2bc8ed46e87df7fe0e2c6124323ade05ea62a82115738e9
Contents?: true
Size: 702 Bytes
Versions: 5
Compression:
Stored size: 702 Bytes
Contents
# frozen_string_literal: true module Synvert::Core # ReplaceErbStmtWithExprAction to replace erb stmt code to expr, # @example # e.g. <% form_for ... %> => <%= form_for ... %>. class Rewriter::ReplaceErbStmtWithExprAction < NodeMutation::Action # Initialize a ReplaceErbStmtWithExprAction. # # @param node [Synvert::Core::Rewriter::Node] def initialize(node) super(node, nil) end # The new erb expr code. # # @return [String] new code. def new_code '=' end private # Calculate the begin the end positions. def calculate_position @start = NodeMutation.adapter.get_start(@node) - 1 @end = @start end end end
Version data entries
5 entries across 5 versions & 1 rubygems