class Irc::Bot::DataFilter

The DataFilter class. A DataFilter is a wrapper around a block that can be run on a DataStream to process it. The block is supposed to return another DataStream object

Public Class Methods

new(&block) click to toggle source
# File lib/rbot/core/utils/filters.rb, line 40
def initialize(&block)
  raise "No block provided" unless block_given?
  @block = block
end

Public Instance Methods

call(stream) click to toggle source
# File lib/rbot/core/utils/filters.rb, line 45
def call(stream)
  @block.call(stream)
end
Also aliased as: run, filter
filter(stream)
Alias for: call
run(stream)
Alias for: call