Class: LibRubyParser::Nodes::ArrayPattern

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents an array pattern used in pattern matching

Instance Attribute Summary collapse

Instance Attribute Details

#begin_lLoc? (readonly)

Location of the open bracket

[1, ^a, 3 => foo]
~

None for pattern like 1, 2 without brackets

Returns:



220
221
222
# File 'lib/lib-ruby-parser/nodes.rb', line 220

def begin_l
  @begin_l
end

#elements::Array<Node> (readonly)

A list of elements

Returns:



209
210
211
# File 'lib/lib-ruby-parser/nodes.rb', line 209

def elements
  @elements
end

#end_lLoc? (readonly)

Location of the closing bracket

[1, ^a, 3 => foo]
                ~

None for pattern like 1, 2 without brackets

Returns:



231
232
233
# File 'lib/lib-ruby-parser/nodes.rb', line 231

def end_l
  @end_l
end

#expression_lLoc (readonly)

Location of the full expression

[1, ^a, 3 => foo]
~~~~~~~~~~~~~~~~~

Returns:



240
241
242
# File 'lib/lib-ruby-parser/nodes.rb', line 240

def expression_l
  @expression_l
end