Module: Pacer::Transform::Path

Defined in:
lib/pacer/transform/path.rb

Instance Method Summary collapse

Instance Method Details

#help(section = nil) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/pacer/transform/path.rb', line 22

def help(section = nil)
  case section
  when nil
    puts "Each path returned by this method represents each intermediate value that was\nused to calculate the resulting value:\n\n  r = [1,2,3].to_route.map { |n| n*2 }\n  p = r.paths                           #=> #<Obj -> Obj-Map -> Path-Path>\n  p.to_a                                #=> [[1,1], [2,4], [3,6]]\n\nThis is especially useful for graph traversals.\n\n  g.v.out_e.in_v.out_e.in_v.paths.first #=> [#<V[37]>,\n                                  #    #<E[41]:37-patcit-38>,\n                                  #    #<V[38]>,\n                                  #    #<E[40]:38-document-id-39>,\n                                  #    #<V[39]>]\n\nSee:\n  :paths  - for more details and general information about paths.\n  :arrays - for general operations that work on arrays or paths.\n\n"
  else
    super
  end
  description
end