Class: ReduceContext
- Inherits:
-
Object
- Object
- ReduceContext
- Defined in:
- lib/learn_mapreduce.rb
Overview
The context within the reducer Used to give a custom ‘emit’ function
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #emit(value) ⇒ Object
-
#initialize ⇒ ReduceContext
constructor
A new instance of ReduceContext.
Constructor Details
#initialize ⇒ ReduceContext
Returns a new instance of ReduceContext.
90 91 92 |
# File 'lib/learn_mapreduce.rb', line 90 def initialize @output = [] end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
88 89 90 |
# File 'lib/learn_mapreduce.rb', line 88 def output @output end |
Instance Method Details
#emit(value) ⇒ Object
94 95 96 |
# File 'lib/learn_mapreduce.rb', line 94 def emit value @output.push(value) end |