Class: MatchReduce::Processor::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/match_reduce/processor/result.rb

Overview

This is the main resulting value object returned, one per aggregator.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, records, value) ⇒ Result

Returns a new instance of Result.



16
17
18
19
20
21
22
# File 'lib/match_reduce/processor/result.rb', line 16

def initialize(name, records, value)
  @name     = name
  @records  = records
  @value    = value

  freeze
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/match_reduce/processor/result.rb', line 14

def name
  @name
end

#recordsObject (readonly)

Returns the value of attribute records.



14
15
16
# File 'lib/match_reduce/processor/result.rb', line 14

def records
  @records
end

#valueObject (readonly)

Returns the value of attribute value.



14
15
16
# File 'lib/match_reduce/processor/result.rb', line 14

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



28
29
30
31
32
33
# File 'lib/match_reduce/processor/result.rb', line 28

def ==(other)
  other.instance_of?(self.class) &&
    name == other.name &&
    records == other.records &&
    value == other.value
end

#hashObject



24
25
26
# File 'lib/match_reduce/processor/result.rb', line 24

def hash
  [name, records, value].hash
end