Class: Rubinius::AST::Module
- Defined in:
- lib/compiler/ast/definitions.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, name, body) ⇒ Module
constructor
A new instance of Module.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, name, body) ⇒ Module
Returns a new instance of Module.
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 |
# File 'lib/compiler/ast/definitions.rb', line 524 def initialize(line, name, body) @line = line case name when Symbol @name = ModuleName.new line, name when ToplevelConstant @name = ToplevelModuleName.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
Returns the value of attribute body.
522 523 524 |
# File 'lib/compiler/ast/definitions.rb', line 522 def body @body end |
#name ⇒ Object
Returns the value of attribute name.
522 523 524 |
# File 'lib/compiler/ast/definitions.rb', line 522 def name @name end |
Instance Method Details
#to_sexp ⇒ Object
543 544 545 |
# File 'lib/compiler/ast/definitions.rb', line 543 def to_sexp [:module, @name.to_sexp, @body.to_sexp] end |