Class: DaimonSkycrawlers::Filter::Base

Inherits:
Object
  • Object
show all
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

DuplicateChecker, RobotsTxtChecker, UpdateChecker

Instance Method Summary collapse

Methods included from LoggerMixin

included

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

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/daimon_skycrawlers/filter/base.rb', line 27

def call(message)
  raise NotImplementedError, "Must implement this method in subclass"
end

#storageObject



23
24
25
# File 'lib/daimon_skycrawlers/filter/base.rb', line 23

def storage
  @storage ||= DaimonSkycrawlers::Storage::RDB.new
end