Class: IV::Phonic::AST::IdentifierAccess

Inherits:
Expression show all
Defined in:
lib/iv/phonic/ast.rb

Instance Method Summary collapse

Methods inherited from Expression

as

Methods inherited from Node

#begin_position, #end_position, #program, #source

Constructor Details

#initialize(parent, expr) ⇒ IdentifierAccess

Returns a new instance of IdentifierAccess.



497
498
499
500
501
# File 'lib/iv/phonic/ast.rb', line 497

def initialize parent, expr
  super parent, expr
  @target = Expression.as self, expr[:target]
  @key = Identifier.new self, expr[:key]
end

Instance Method Details

#to_sourceObject



503
504
505
# File 'lib/iv/phonic/ast.rb', line 503

def to_source
  "#{@target.to_source}.#{@key.to_source}"
end