Class: Irc::Bot::DataFilter
Overview
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
Instance Method Summary collapse
- #call(stream) ⇒ Object (also: #run, #filter)
-
#initialize(&block) ⇒ DataFilter
constructor
A new instance of DataFilter.
Constructor Details
#initialize(&block) ⇒ DataFilter
Returns a new instance of DataFilter.
40 41 42 43 |
# File 'lib/rbot/core/utils/filters.rb', line 40 def initialize(&block) raise "No block provided" unless block_given? @block = block end |
Instance Method Details
#call(stream) ⇒ Object Also known as: run, filter
45 46 47 |
# File 'lib/rbot/core/utils/filters.rb', line 45 def call(stream) @block.call(stream) end |