Class: RBI::Rewriters::AttrToMethods

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

Instance Method Summary collapse

Methods inherited from Visitor

#visit_all, #visit_file

Instance Method Details

#visit(node) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/rbi/rewriters/attr_to_methods.rb', line 26

def visit(node)
  case node
  when Tree
    visit_all(node.nodes.dup)

  when Attr
    replace(node, with: node.convert_to_methods)
  end
end