Class: CodeTools::AST::VariableAssignment
- Defined in:
- lib/rubinius/code/ast/variables.rb
Direct Known Subclasses
ClassVariableAssignment, GlobalVariableAssignment, InstanceVariableAssignment, LocalVariableAssignment
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #defined(g) ⇒ Object
-
#initialize(line, name, value) ⇒ VariableAssignment
constructor
A new instance of VariableAssignment.
- #to_sexp ⇒ Object
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.
121 122 123 124 125 |
# File 'lib/rubinius/code/ast/variables.rb', line 121 def initialize(line, name, value) @line = line @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
119 120 121 |
# File 'lib/rubinius/code/ast/variables.rb', line 119 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
119 120 121 |
# File 'lib/rubinius/code/ast/variables.rb', line 119 def value @value end |
Instance Method Details
#defined(g) ⇒ Object
127 128 129 |
# File 'lib/rubinius/code/ast/variables.rb', line 127 def defined(g) g.push_literal "assignment" end |
#to_sexp ⇒ Object
131 132 133 134 135 |
# File 'lib/rubinius/code/ast/variables.rb', line 131 def to_sexp sexp = [sexp_name, @name] sexp << @value.to_sexp if @value sexp end |