Class: Melbourne::AST::ConstAtTop

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/constants.rb

Overview

A constant in the top level as in:

::X

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, name) ⇒ ConstAtTop

Returns a new instance of ConstAtTop.



41
42
43
44
45
# File 'lib/melbourne/ast/constants.rb', line 41

def initialize(line, name)
  @line = line
  @name = name
  @parent = TopLevel.new line
end

Instance Attribute Details

#nameObject

The name of the node



39
40
41
# File 'lib/melbourne/ast/constants.rb', line 39

def name
  @name
end

#parentObject

The parent node



35
36
37
# File 'lib/melbourne/ast/constants.rb', line 35

def parent
  @parent
end