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

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

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, value) ⇒ ToArray

Returns a new instance of ToArray.



137
138
139
140
# File 'lib/rubinius/ast/values.rb', line 137

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

Instance Attribute Details

#valueObject

Returns the value of attribute value.



135
136
137
# File 'lib/rubinius/ast/values.rb', line 135

def value
  @value
end

Instance Method Details

#bytecode(g) ⇒ Object



142
143
144
145
146
147
# File 'lib/rubinius/ast/values.rb', line 142

def bytecode(g)
  pos(g)

  @value.bytecode(g)
  g.cast_multi_value
end

#to_sexpObject



149
150
151
# File 'lib/rubinius/ast/values.rb', line 149

def to_sexp
  [:to_ary, @value.to_sexp]
end