Class: Rivulet::CountStream

Inherits:
Stream
  • Object
show all
Defined in:
lib/rivulet/count_stream.rb

Instance Method Summary collapse

Methods inherited from Stream

#initialize, #iterate_windows, #max_window, #min_window, #tumbling, #windows

Constructor Details

This class inherits a constructor from Rivulet::Stream

Instance Method Details

#max_distinct_while(&rule) ⇒ Object



5
6
7
8
9
# File 'lib/rivulet/count_stream.rb', line 5

def max_distinct_while(&rule)
  best = 0
  each_max_window(rule) { |w| best = w.distinct if w.distinct > best }
  best
end