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.
65 66 67 |
# File 'lib/learn_mapreduce.rb', line 65 def initialize @output = [] end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
63 64 65 |
# File 'lib/learn_mapreduce.rb', line 63 def output @output end |
Instance Method Details
#emit(value) ⇒ Object
69 70 71 |
# File 'lib/learn_mapreduce.rb', line 69 def emit value @output.push(value) end |