Sha256: fc73d7d8c67baddacba5cc5eb6b074297d62de9b27070c7bd374d21013472946

Contents?: true

Size: 235 Bytes

Versions: 2

Compression:

Stored size: 235 Bytes

Contents

module Frappuccino
  class Select < Stream
    def initialize(source, &blk)
      @block = blk
      source.add_observer(self)
    end

    def update(event)
      if @block.call(event)
        occur(event)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frappuccino-0.3.0 lib/frappuccino/stream/select.rb
frappuccino-0.2.0 lib/frappuccino/stream/select.rb