Module: RubyReduce

Defined in:
lib/ruby_reduce.rb,
lib/ruby_reduce/map.rb,
lib/ruby_reduce/reduce.rb,
lib/ruby_reduce/out_put.rb,
lib/ruby_reduce/version.rb,
lib/ruby_reduce/input_reader.rb

Defined Under Namespace

Classes: InputReader, Map, OutputWriter, Reduce

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.reduce(options) ⇒ Object

Your code goes here…



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby_reduce.rb', line 12

def self.reduce(options)
  input = InputReader.new(options[:input]) 
  read = input.read

  map = Map.new(read, options[:map])
  map.map

  reduce = Reduce.new(map.map, options[:reduce])
  result = reduce.reduce

  OutputWriter.new(options[:output]).write(result)
  
end