Class: Rubinius::AST::ScopedConstant

Inherits:
Node
  • Object
show all
Defined in:
lib/compiler/ast/constants.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

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, parent, name) ⇒ ScopedConstant

Returns a new instance of ScopedConstant.



15
16
17
18
19
# File 'lib/compiler/ast/constants.rb', line 15

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/compiler/ast/constants.rb', line 13

def name
  @name
end

#parentObject

Returns the value of attribute parent.



13
14
15
# File 'lib/compiler/ast/constants.rb', line 13

def parent
  @parent
end

Instance Method Details

#to_sexpObject Also known as: assign_sexp



21
22
23
# File 'lib/compiler/ast/constants.rb', line 21

def to_sexp
  [:colon2, @parent.to_sexp, @name]
end