Class: CodeTools::AST::ModuleScope

Inherits:
ClosedScope show all
Defined in:
lib/rubinius/code/ast/definitions.rb

Instance Attribute Summary

Attributes inherited from ClosedScope

#body

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from ClosedScope

#assign_local_reference, #attach_and_call, #nest_scope, #new_local, #new_nested_local, #search_local, #to_sexp

Methods inherited from Node

#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #to_sexp, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(line, name, body) ⇒ ModuleScope

Returns a new instance of ModuleScope.



1057
1058
1059
1060
1061
# File 'lib/rubinius/code/ast/definitions.rb', line 1057

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

Instance Method Details

#bytecode(g) ⇒ Object



1067
1068
1069
1070
1071
# File 'lib/rubinius/code/ast/definitions.rb', line 1067

def bytecode(g)
  pos(g)

  attach_and_call g, :__module_init__, true
end

#module?Boolean

Returns:

  • (Boolean)


1063
1064
1065
# File 'lib/rubinius/code/ast/definitions.rb', line 1063

def module?
  true
end