Class: Rubinius::AST::ArrayLiteral
- Defined in:
- lib/compiler/ast/literals.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, array) ⇒ ArrayLiteral
constructor
A new instance of ArrayLiteral.
- #to_sexp ⇒ Object
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, array) ⇒ ArrayLiteral
Returns a new instance of ArrayLiteral.
8 9 10 11 |
# File 'lib/compiler/ast/literals.rb', line 8 def initialize(line, array) @line = line @body = array end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/compiler/ast/literals.rb', line 6 def body @body end |
Instance Method Details
#to_sexp ⇒ Object
13 14 15 |
# File 'lib/compiler/ast/literals.rb', line 13 def to_sexp @body.inject([:array]) { |s, x| s << x.to_sexp } end |