class RPath::VertexArrayExpression
An expression that evaluates to a vertex array A @abstract
Public Instance Methods
[](subscript)
click to toggle source
@overload [](index)
Returns an expression that evaluates to the vertex at index +index+ in A. @param [Integer] index @return [At]
@overload [](conditions)
Returns an expression that evaluates to the vertices in A meeting certain conditions. @param [Hash] conditions @return [Where] @see Where#initialize
@overload [](attribute)
Returns an expression that evaluates to the value of an attribute of the first vertex in A. Enables omitting the indexer in +RPath { foo['bar'] }+ @param [String, Symbol] attribute @return [Attribute]
@raise [ArgumentError]
+subscript+ is not an Integer, Hash, String, or Symbol
# File lib/rpath/expressions.rb, line 121 def [](subscript) case subscript when Integer At.new self, subscript when Hash Where.new self, subscript when String, Symbol self[0][subscript] else raise ArgumentError, "Subscript for expression producing a vertex must be an Integer, Hash, String, or Symbol" end end
method_missing(name, *args, &block)
click to toggle source
Constructs an {At} that evaluates to the first vertex in A; forwards the method invocation to this {At}. Enables omitting the indexer in expressions like +RPath { foo.bar }+.
# File lib/rpath/expressions.rb, line 137 def method_missing(name, *args, &block) self[0].send name, *args, &block end
named(name)
click to toggle source
Returns an expression that evaluates to the vertices in A named name
. @param [String] name @return [Named]
# File lib/rpath/expressions.rb, line 98 def named(name) Named.new self, name end
where(*args, &block)
click to toggle source
Returns an expression that evaluates to the vertices in A meeting certain conditions. @return [Where] @see Where#initialize
# File lib/rpath/expressions.rb, line 91 def where(*args, &block) Where.new self, *args, &block end