Class: SyntaxTree::RBS::Root

Inherits:
Object
  • Object
show all
Includes:
Entrypoints
Defined in:
lib/syntax_tree/rbs/entrypoints.rb

Overview

This is the root node of the entire tree. It contains all of the top-level declarations within the file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Entrypoints

#format, #pretty_print

Constructor Details

#initialize(declarations) ⇒ Root

Returns a new instance of Root.



25
26
27
# File 'lib/syntax_tree/rbs/entrypoints.rb', line 25

def initialize(declarations)
  @declarations = declarations
end

Instance Attribute Details

#declarationsObject (readonly)

Returns the value of attribute declarations.



23
24
25
# File 'lib/syntax_tree/rbs/entrypoints.rb', line 23

def declarations
  @declarations
end

Instance Method Details

#accept(visitor) ⇒ Object



29
30
31
# File 'lib/syntax_tree/rbs/entrypoints.rb', line 29

def accept(visitor)
  visitor.visit_root(self)
end