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