Class: DeadCodeTerminator::Ast

Inherits:
Object
  • Object
show all
Defined in:
lib/dead_code_terminator/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env:, ast:) ⇒ Ast

Returns a new instance of Ast.



7
8
9
10
# File 'lib/dead_code_terminator/ast.rb', line 7

def initialize(env:, ast:)
  @env = env
  @ast = ast
end

Instance Attribute Details

#astObject (readonly)

Returns the value of attribute ast.



5
6
7
# File 'lib/dead_code_terminator/ast.rb', line 5

def ast
  @ast
end

#envObject (readonly)

Returns the value of attribute env.



5
6
7
# File 'lib/dead_code_terminator/ast.rb', line 5

def env
  @env
end

Instance Method Details

#processObject



12
13
14
15
16
# File 'lib/dead_code_terminator/ast.rb', line 12

def process
  erase_before!
  erase_after!
  rewriter.process
end