Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/grandprix.rb

Instance Method Summary collapse

Instance Method Details

#flat_mapObject



24
25
26
27
28
29
30
# File 'lib/grandprix.rb', line 24

def flat_map
  self.reduce([]) do |so_far, current|
    key = current[0]
    value = current[1]
    so_far + yield(key, value)
  end
end