Class: Melbourne::AST::ScopedModuleName

Inherits:
ModuleName show all
Defined in:
lib/melbourne/ast/definitions.rb

Overview

A scoped module name as in:

module X::M; end

Instance Attribute Summary collapse

Attributes inherited from ModuleName

#name

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, parent) ⇒ ScopedModuleName

Returns a new instance of ScopedModuleName.



448
449
450
451
452
# File 'lib/melbourne/ast/definitions.rb', line 448

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

Instance Attribute Details

#parentObject

The parent of the scoped module name; for a module module X::M; end the scoped module name is Y and the parent is X



446
447
448
# File 'lib/melbourne/ast/definitions.rb', line 446

def parent
  @parent
end