Class: Melbourne::AST::ScopedClassName

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

Overview

A scoped class name as in:

class X::Y; end

Instance Attribute Summary collapse

Attributes inherited from ClassName

#name, #superclass

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, parent, superclass) ⇒ ScopedClassName

Returns a new instance of ScopedClassName.



374
375
376
377
378
379
# File 'lib/melbourne/ast/definitions.rb', line 374

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

Instance Attribute Details

#parentObject

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



372
373
374
# File 'lib/melbourne/ast/definitions.rb', line 372

def parent
  @parent
end