Class: MapRedus::WordCounter

Inherits:
Mapper show all
Defined in:
lib/mapredus/default_classes.rb

Class Method Summary collapse

Methods inherited from Mapper

perform

Methods inherited from QueueProcess

perform, queue

Class Method Details

.map(map_data) ⇒ Object



21
22
23
24
25
26
# File 'lib/mapredus/default_classes.rb', line 21

def self.map(map_data)
  map_data.split(/\W/).each do |word|
    next if word.empty?
    yield(word.downcase, 1)
  end
end