class RPath::Attribute
Given a prior expression producing a vertex V, evaluates to the value of the attribute of V with the given name.
Public Class Methods
new(prior, name)
click to toggle source
@param [Expression] prior
An expression that evaluates to a vertex
@param [String] name
The name of the attribute
Calls superclass method
# File lib/rpath/expressions.rb, line 291 def initialize(prior, name) super() @prior = prior @name = name end
Public Instance Methods
to_s()
click to toggle source
@return [String]
# File lib/rpath/expressions.rb, line 298 def to_s "#{@prior}[#{@name}]" end
Private Instance Methods
do_eval(graph, adapter)
click to toggle source
# File lib/rpath/expressions.rb, line 304 def do_eval(graph, adapter) vertex = @prior.eval(graph, adapter) vertex && adapter.attribute(vertex, @name) end