Class: Chelsy::IndexDesignator

Inherits:
Designator show all
Defined in:
lib/chelsy/ast.rb

Overview

{ [1] = 10, [2] = 20, ...}

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Constructor Details

#initialize(index, **rest) ⇒ IndexDesignator

Returns a new instance of IndexDesignator.



202
203
204
205
# File 'lib/chelsy/ast.rb', line 202

def initialize(index, **rest)
  @index = Syntax::Expr.ensure(index)
  super **rest
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



200
201
202
# File 'lib/chelsy/ast.rb', line 200

def index
  @index
end