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

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

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph, #attributes, #bytecode, #children, 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, value) ⇒ VariableAssignment

Returns a new instance of VariableAssignment.



123
124
125
126
127
# File 'lib/rubinius/ast/variables.rb', line 123

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



121
122
123
# File 'lib/rubinius/ast/variables.rb', line 121

def name
  @name
end

#valueObject

Returns the value of attribute value.



121
122
123
# File 'lib/rubinius/ast/variables.rb', line 121

def value
  @value
end

Instance Method Details

#defined(g) ⇒ Object



129
130
131
# File 'lib/rubinius/ast/variables.rb', line 129

def defined(g)
  g.push_literal "assignment"
end

#to_sexpObject



133
134
135
136
137
# File 'lib/rubinius/ast/variables.rb', line 133

def to_sexp
  sexp = [sexp_name, @name]
  sexp << @value.to_sexp if @value
  sexp
end