Class: Rubinius::ToolSet.current::TS::AST::ClassName

Inherits:
Node
  • Object
show all
Defined in:
lib/rubinius/ast/definitions.rb

Direct Known Subclasses

ScopedClassName, ToplevelClassName

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

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, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(line, name, superclass) ⇒ ClassName

Returns a new instance of ClassName.



741
742
743
744
745
# File 'lib/rubinius/ast/definitions.rb', line 741

def initialize(line, name, superclass)
  @line = line
  @name = name
  @superclass = superclass
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



739
740
741
# File 'lib/rubinius/ast/definitions.rb', line 739

def name
  @name
end

#superclassObject

Returns the value of attribute superclass.



739
740
741
# File 'lib/rubinius/ast/definitions.rb', line 739

def superclass
  @superclass
end

Instance Method Details

#bytecode(g) ⇒ Object



753
754
755
756
757
758
759
# File 'lib/rubinius/ast/definitions.rb', line 753

def bytecode(g)
  pos(g)

  name_bytecode(g)
  g.push_scope
  g.send :open_class, 3
end

#name_bytecode(g) ⇒ Object



747
748
749
750
751
# File 'lib/rubinius/ast/definitions.rb', line 747

def name_bytecode(g)
  g.push_rubinius
  g.push_literal @name
  @superclass.bytecode(g)
end

#to_sexpObject



761
762
763
# File 'lib/rubinius/ast/definitions.rb', line 761

def to_sexp
  @name
end