Class: DaimonSkycrawlers::Filter::Base
- Inherits:
-
Object
- Object
- DaimonSkycrawlers::Filter::Base
- Includes:
- ConfigMixin, LoggerMixin
- Defined in:
- lib/daimon_skycrawlers/filter/base.rb
Overview
Base class of filters.
You must implement ‘#call` in your filter and it must return true or false. If your filter returns true, processors can process given URL after your filter. Otherwise framework skips given URL to skip processors.
Direct Known Subclasses
Instance Method Summary collapse
- #call(message) ⇒ Object
-
#initialize(storage: nil) ⇒ Base
constructor
A new instance of Base.
- #storage ⇒ Object
Methods included from LoggerMixin
Constructor Details
#initialize(storage: nil) ⇒ Base
Returns a new instance of Base.
18 19 20 21 |
# File 'lib/daimon_skycrawlers/filter/base.rb', line 18 def initialize(storage: nil) super() @storage = storage end |
Instance Method Details
#call(message) ⇒ Object
27 28 29 |
# File 'lib/daimon_skycrawlers/filter/base.rb', line 27 def call() raise NotImplementedError, "Must implement this method in subclass" end |
#storage ⇒ Object
23 24 25 |
# File 'lib/daimon_skycrawlers/filter/base.rb', line 23 def storage @storage ||= DaimonSkycrawlers::Storage::RDB.new end |