class Frappuccino::Drop

Public Class Methods

new(source, n) click to toggle source
# File lib/frappuccino/stream/drop.rb, line 3
def initialize(source, n)
  source.add_observer(self)

  @dropped = 0
  @n = n
end

Public Instance Methods

update(event) click to toggle source
# File lib/frappuccino/stream/drop.rb, line 10
def update(event)
  @dropped += 1

  if @dropped > @n
    occur(event)
  end
end