Class: IV::Phonic::AST::IndexAccess
- Inherits:
-
Expression
- Object
- Node
- Expression
- IV::Phonic::AST::IndexAccess
- Defined in:
- lib/iv/phonic/ast.rb
Instance Method Summary collapse
-
#initialize(parent, expr) ⇒ IndexAccess
constructor
A new instance of IndexAccess.
- #to_source ⇒ Object
Methods inherited from Expression
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, expr) ⇒ IndexAccess
Returns a new instance of IndexAccess.
485 486 487 488 489 |
# File 'lib/iv/phonic/ast.rb', line 485 def initialize parent, expr super parent, expr @target = Expression.as self, expr[:target] @key = Expression.as self, expr[:key] end |
Instance Method Details
#to_source ⇒ Object
491 492 493 |
# File 'lib/iv/phonic/ast.rb', line 491 def to_source "#{@target.to_source}[#{@key.to_source}]" end |