class RPath::At

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

Public Class Methods

new(prior, index) click to toggle source

@param [Expression] prior

An expression that evaluates to a vertex array

@param [Integer] index

The index of the vertex to produce
Calls superclass method
# File lib/rpath/expressions.rb, line 264
def initialize(prior, index)
  super()
  @prior = prior
  @index = index
end

Public Instance Methods

to_s() click to toggle source

@return [String]

# File lib/rpath/expressions.rb, line 271
def to_s
  "#{@prior}[#{@index}]"
end

Private Instance Methods

do_eval(graph, adapter) click to toggle source
# File lib/rpath/expressions.rb, line 277
def do_eval(graph, adapter)
  vertices = @prior.eval(graph, adapter)
  vertices && vertices[@index]
end