Class: Synvert::Core::Rewriter::RemoveAction

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

Overview

RemoveAction to remove code.

Instance Method Summary collapse

Methods inherited from Action

#<=>, #line, #rewritten_source

Constructor Details

#initialize(instance, code = nil) ⇒ RemoveAction

Returns a new instance of RemoveAction.



203
204
205
# File 'lib/synvert/core/rewriter/action.rb', line 203

def initialize(instance, code=nil)
  super
end

Instance Method Details

#begin_posInteger

Begin position of code to replace.

Returns:

  • (Integer)

    begin position.



210
211
212
# File 'lib/synvert/core/rewriter/action.rb', line 210

def begin_pos
  @node.loc.expression.begin_pos
end

#end_posInteger

End position of code to replace.

Returns:

  • (Integer)

    end position.



217
218
219
# File 'lib/synvert/core/rewriter/action.rb', line 217

def end_pos
  @node.loc.expression.end_pos
end

#rewritten_codeObject

The rewritten code, always empty string.



222
223
224
# File 'lib/synvert/core/rewriter/action.rb', line 222

def rewritten_code
  ''
end