12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/pacer/transform/cap.rb', line 12
def help(section = nil)
case section
when nil
puts "Cap executes the full pipeline until it is empty, discarding all of the\npipeline's results. It then calls getSideEffect from the previous pipe\nsegment and emits that value as the only resulting value of the route.\n\nThe value of getSideEffect is generally calculated by processing each\nelement of the route. A good example is #count which is actually\nimplemented as follows:\n\n r = g.v.counted.cap #=> #<GraphV -> Obj-Cap(V-Counted)>\n r.to_a #=> [123]\n\nIn this example, #counted is a side effect pipe. Side effect pipes can\nbe used on their own but their value is not reliable until the full\npipeline has been processed:\n\n pipe = g.v.counted.pipe\n pipe.getSideEffect #=> 0\n pipe.next #=> #<V[3]>\n pipe.getSideEffect #=> 1\n\n"
else
super
end
description
end
|