Class: CodeTools::AST::DefineSingletonScope
- Inherits:
-
Define
- Object
- Node
- ClosedScope
- Define
- CodeTools::AST::DefineSingletonScope
- Defined in:
- lib/rubinius/code/ast/definitions.rb
Instance Attribute Summary
Attributes inherited from Define
Attributes inherited from ClosedScope
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g, recv) ⇒ Object
-
#initialize(line, name, block) ⇒ DefineSingletonScope
constructor
A new instance of DefineSingletonScope.
Methods inherited from Define
Methods inherited from ClosedScope
#assign_local_reference, #attach_and_call, #module?, #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, block) ⇒ DefineSingletonScope
Returns a new instance of DefineSingletonScope.
314 315 316 |
# File 'lib/rubinius/code/ast/definitions.rb', line 314 def initialize(line, name, block) super line, name, block end |
Instance Method Details
#bytecode(g, recv) ⇒ Object
318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/rubinius/code/ast/definitions.rb', line 318 def bytecode(g, recv) pos(g) g.push_rubinius g.push_literal @name g.push_generator compile_body(g) g.push_scope recv.bytecode(g) g.send :attach_method, 4 end |