Class: RBI::Rewriters::Deannotate

Inherits:
Visitor
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/rbi/rewriters/deannotate.rb

Instance Method Summary collapse

Methods inherited from Visitor

#visit_all, #visit_file

Constructor Details

#initialize(annotation) ⇒ Deannotate

Returns a new instance of Deannotate.



10
11
12
13
# File 'lib/rbi/rewriters/deannotate.rb', line 10

def initialize(annotation)
  super()
  @annotation = annotation
end

Instance Method Details

#visit(node) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rbi/rewriters/deannotate.rb', line 16

def visit(node)
  case node
  when Scope, Const, Attr, Method, TStructField, TypeMember
    deannotate_node(node)
  end
  visit_all(node.nodes) if node.is_a?(Tree)
end