Class: DaimonSkycrawlers::Processor::Base
- Inherits:
-
Object
- Object
- DaimonSkycrawlers::Processor::Base
- Includes:
- Callbacks, ConfigMixin, Configurable, LoggerMixin
- Defined in:
- lib/daimon_skycrawlers/processor/base.rb
Overview
The base class of processor
A processor implementation can inherit this class and override
#call in the class.
Instance Attribute Summary collapse
-
#storage ⇒ Object
Retrieve storage instance.
Instance Method Summary collapse
-
#call(message) ⇒ Object
Process message.
-
#initialize ⇒ Base
constructor
A new instance of Base.
-
#process(message) ⇒ Object
Process processor sequence.
Methods included from Configurable
Methods included from Callbacks
#after_process, #before_process, #clear_after_process_callbacks, #clear_before_process_callbacks, #run_after_process_callbacks, #run_before_process_callbacks
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
25 26 27 28 29 30 |
# File 'lib/daimon_skycrawlers/processor/base.rb', line 25 def initialize super @skipped = false setup_default_filters end |
Instance Attribute Details
#storage ⇒ Object
Retrieve storage instance
69 70 71 |
# File 'lib/daimon_skycrawlers/processor/base.rb', line 69 def storage @storage ||= DaimonSkycrawlers::Storage::RDB.new end |
Instance Method Details
#call(message) ⇒ Object
Process message
Override this method in subclass
62 63 64 |
# File 'lib/daimon_skycrawlers/processor/base.rb', line 62 def call() raise "Implement this method in subclass" end |
#process(message) ⇒ Object
Process processor sequence
- Run registered filters
- Process HTTP response from message
45 46 47 48 49 50 51 52 53 |
# File 'lib/daimon_skycrawlers/processor/base.rb', line 45 def process() @skipped = false proceeding = run_before_process_callbacks() unless proceeding skip([:url]) return end call() end |