Class: Synvert::Core::Rewriter::ReplaceErbStmtWithExprAction

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

Overview

ReplaceErbStmtWithExprAction to replace erb stmt code to expr,

Examples:

e.g. <% form_for ... %> => <%= form_for ... %>.

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ ReplaceErbStmtWithExprAction

Initialize a ReplaceErbStmtWithExprAction.

Parameters:

  • node (Synvert::Core::Rewriter::Node)


11
12
13
# File 'lib/synvert/core/rewriter/action/replace_erb_stmt_with_expr_action.rb', line 11

def initialize(node)
  super(node, nil)
end

Instance Method Details

#new_codeString

The new erb expr code.

Returns:

  • (String)

    new code.



18
19
20
# File 'lib/synvert/core/rewriter/action/replace_erb_stmt_with_expr_action.rb', line 18

def new_code
  '='
end