module Gemmy::Patches::EnumeratorPatch::InstanceMethods::Graph
Facets Similar to map by (array => hash) but values are not wrapped in arrays iteration return val is [key, val]
Public Instance Methods
graph(&yld)
click to toggle source
# File lib/gemmy/patches/enumerator_patch.rb, line 11 def graph(&yld) if yld h = {} each do |*kv| r = yld[*kv] case r when Hash nk, nv = *r.to_a[0] when Range nk, nv = r.first, r.last else nk, nv = *r end h[nk] = nv end h else Enumerator.new(self,:graph) end end