Class: RBI::Rewriters::AddSigTemplates

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

Instance Method Summary collapse

Methods inherited from Visitor

#visit_all, #visit_file

Constructor Details

#initialize(with_todo_comment: true) ⇒ AddSigTemplates

Returns a new instance of AddSigTemplates.



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

def initialize(with_todo_comment: true)
  super()
  @with_todo_comment = with_todo_comment
end

Instance Method Details

#visit(node) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/rbi/rewriters/add_sig_templates.rb', line 16

def visit(node)
  case node
  when Tree
    visit_all(node.nodes)
  when Attr
    add_attr_sig(node)
  when Method
    add_method_sig(node)
  end
end