Class: Melbourne::AST::Class
- Defined in:
- lib/melbourne/ast/definitions.rb
Overview
A class as in:
class X; end
Instance Attribute Summary collapse
-
#body ⇒ Object
The body of the
class. -
#name ⇒ Object
The name of the
class. -
#superclass ⇒ Object
The superclass of the
class.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, name, superclass, body) ⇒ Class
constructor
A new instance of Class.
Methods inherited from Node
Constructor Details
#initialize(line, name, superclass, body) ⇒ Class
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/melbourne/ast/definitions.rb', line 311 def initialize(line, name, superclass, body) @line = line @superclass = superclass ? superclass : Nil.new(line) if name.kind_of? Symbol @name = ClassName.new line, name, @superclass else @name = ScopedClassName.new line, name, @superclass end if body @body = ClassScope.new line, @name, body else @body = EmptyBody.new line end end |
Instance Attribute Details
#body ⇒ Object
The body of the class
309 310 311 |
# File 'lib/melbourne/ast/definitions.rb', line 309 def body @body end |
#name ⇒ Object
The name of the class
301 302 303 |
# File 'lib/melbourne/ast/definitions.rb', line 301 def name @name end |
#superclass ⇒ Object
The superclass of the class
305 306 307 |
# File 'lib/melbourne/ast/definitions.rb', line 305 def superclass @superclass end |