Class: Synvert::Rewriter::RemoveAction

Inherits:
Action
  • Object
show all
Defined in:
lib/synvert/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



201
202
203
# File 'lib/synvert/rewriter/action.rb', line 201

def initialize(instance, code=nil)
  super
end

Instance Method Details

#begin_posInteger

Begin position of code to replace.



208
209
210
# File 'lib/synvert/rewriter/action.rb', line 208

def begin_pos
  @node.loc.expression.begin_pos
end

#end_posInteger

End position of code to replace.



215
216
217
# File 'lib/synvert/rewriter/action.rb', line 215

def end_pos
  @node.loc.expression.end_pos
end

#rewritten_codeObject

The rewritten code, always empty string.



220
221
222
# File 'lib/synvert/rewriter/action.rb', line 220

def rewritten_code
  ''
end