Class: FIDIUS::EvasionDB::Fetcher
- Inherits:
-
Object
- Object
- FIDIUS::EvasionDB::Fetcher
- Defined in:
- lib/evasion-db/idmef-fetchers/fetchers.rb
Overview
A Fetcher is used to fetch events from an ids
Constant Summary collapse
- @@fetchers =
[]
Instance Attribute Summary collapse
-
#local_ip ⇒ Object
Returns the value of attribute local_ip.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #begin_record ⇒ Object
- #config(conf) ⇒ Object
- #fetch_events ⇒ Object
-
#initialize(name, &block) ⇒ Fetcher
constructor
A new instance of Fetcher.
- #install(&block) ⇒ Object
- #run_install ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Fetcher
Returns a new instance of Fetcher.
20 21 22 23 24 25 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 20 def initialize(name,&block) self.instance_eval(&block) @local_ip = nil @name = name @@fetchers << self end |
Instance Attribute Details
#local_ip ⇒ Object
Returns the value of attribute local_ip.
18 19 20 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 18 def local_ip @local_ip end |
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 17 def name @name end |
Class Method Details
.all ⇒ Object
50 51 52 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 50 def self.all @@fetchers end |
.by_name(name) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 54 def self.by_name(name) self.all.each do |fetcher| return fetcher if fetcher.name == name end nil end |
Instance Method Details
#begin_record ⇒ Object
42 43 44 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 42 def begin_record raise "overwrite this" end |
#config(conf) ⇒ Object
38 39 40 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 38 def config(conf) raise "overwrite this" end |
#fetch_events ⇒ Object
46 47 48 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 46 def fetch_events raise "overwrite this" end |
#install(&block) ⇒ Object
27 28 29 30 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 27 def install(&block) $logger.debug "setting installblock" @install = block end |
#run_install ⇒ Object
32 33 34 35 36 |
# File 'lib/evasion-db/idmef-fetchers/fetchers.rb', line 32 def run_install raise "no install block given" unless @install $logger.debug "run install of #{@name}" @install.call end |