Class: Melbourne::AST::Module
- Defined in:
- lib/melbourne/ast/definitions.rb
Overview
A module as in:
module M; end
Instance Attribute Summary collapse
-
#body ⇒ Object
The body of the module.
-
#name ⇒ Object
The name of the module.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, name, body) ⇒ Module
constructor
A new instance of Module.
Methods inherited from Node
Constructor Details
#initialize(line, name, body) ⇒ Module
Returns a new instance of Module.
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/melbourne/ast/definitions.rb', line 397 def initialize(line, name, body) @line = line if name.kind_of? Symbol @name = ModuleName.new line, name else @name = ScopedModuleName.new line, name end if body @body = ModuleScope.new line, @name, body else @body = EmptyBody.new line end end |
Instance Attribute Details
#body ⇒ Object
The body of the module
395 396 397 |
# File 'lib/melbourne/ast/definitions.rb', line 395 def body @body end |
#name ⇒ Object
The name of the module
391 392 393 |
# File 'lib/melbourne/ast/definitions.rb', line 391 def name @name end |