Top Level Namespace
Defined Under Namespace
Modules: RPath
Instance Method Summary collapse
-
#RPath(graph = nil, adapter = nil, &block) ⇒ Object
Constructs an RPath expression and optionally evaluates it on a graph.
Instance Method Details
#RPath {|root| ... } ⇒ RPath::Expression #RPath(graph, adapter = nil) {|root| ... } ⇒ Object
Constructs an RPath expression and optionally evaluates it on a graph.
93 94 95 96 97 98 99 100 101 |
# File 'lib/rpath.rb', line 93 def RPath(graph = nil, adapter = nil, &block) exp = RPath::Root.new if block_given? exp = block.arity > 0 ? block.call(exp) : exp.instance_eval(&block) end graph ? exp.eval(graph, adapter) : exp end |