Class: MaxAggregator
- Inherits:
-
Object
- Object
- MaxAggregator
- Defined in:
- lib/tb/cmdutil.rb
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize ⇒ MaxAggregator
constructor
A new instance of MaxAggregator.
- #update(v) ⇒ Object
Constructor Details
#initialize ⇒ MaxAggregator
Returns a new instance of MaxAggregator.
157 |
# File 'lib/tb/cmdutil.rb', line 157 def initialize() @v = nil; @cmp = nil end |
Instance Method Details
#finish ⇒ Object
166 |
# File 'lib/tb/cmdutil.rb', line 166 def finish() @v end |
#update(v) ⇒ Object
158 159 160 161 162 163 164 165 |
# File 'lib/tb/cmdutil.rb', line 158 def update(v) cmp = smart_cmp_value(v) if @cmp == nil @v, @cmp = v, cmp else @v, @cmp = v, cmp if (@cmp <=> cmp) < 0 end end |