Class: CodeTools::AST::DefineSingletonScope

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

Instance Attribute Summary

Attributes inherited from Define

#arguments, #name

Attributes inherited from ClosedScope

#body

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Define

#compile_body, #to_sexp

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.



302
303
304
# File 'lib/rubinius/code/ast/definitions.rb', line 302

def initialize(line, name, block)
  super line, name, block
end

Instance Method Details

#bytecode(g, recv) ⇒ Object



306
307
308
309
310
311
312
313
314
315
316
# File 'lib/rubinius/code/ast/definitions.rb', line 306

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