Class: RPath::At

Inherits:
VertexExpression show all
Defined in:
lib/rpath/expressions.rb

Overview

Given a prior expression producing vertex array A, evaluates to the vertex in A at a given index.

Instance Method Summary collapse

Methods inherited from VertexExpression

#[], #adjacent, #content, #method_missing

Methods inherited from Expression

#eval

Constructor Details

#initialize(prior, index) ⇒ At

Returns a new instance of At.

Parameters:

  • prior (Expression)

    An expression that evaluates to a vertex array

  • index (Integer)

    The index of the vertex to produce



264
265
266
267
268
# File 'lib/rpath/expressions.rb', line 264

def initialize(prior, index)
  super()
  @prior = prior
  @index = index
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RPath::VertexExpression

Instance Method Details

#to_sString

Returns:

  • (String)


271
272
273
# File 'lib/rpath/expressions.rb', line 271

def to_s
  "#{@prior}[#{@index}]"
end