Class: Array

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

Instance Method Summary collapse

Instance Method Details

#flat_mapObject



14
15
16
# File 'lib/grandprix.rb', line 14

def flat_map
  self.reduce([]) {|so_far, current| so_far + yield(current)}
end

#to_ordered_hashObject



18
19
20
# File 'lib/grandprix.rb', line 18

def to_ordered_hash
  ActiveSupport::OrderedHash[self]
end