Class: Melbourne::AST::ArrayLiteral

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/literals.rb

Overview

An array literal as in:

[1, 2]

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, array) ⇒ ArrayLiteral

Returns a new instance of ArrayLiteral.



15
16
17
18
# File 'lib/melbourne/ast/literals.rb', line 15

def initialize(line, array)
  @line = line
  @body = array
end

Instance Attribute Details

#bodyObject

The body os the array literal (the actual values contained in the array)



13
14
15
# File 'lib/melbourne/ast/literals.rb', line 13

def body
  @body
end