Class: FIDIUS::EvasionDB::Recorder
- Inherits:
-
Object
- Object
- FIDIUS::EvasionDB::Recorder
- Defined in:
- lib/evasion-db/recorders/recorders.rb
Overview
A Recorder us used to log packets for an executed attack
Constant Summary collapse
- @@recorders =
[]
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Recorder
constructor
A new instance of Recorder.
- #install(&block) ⇒ Object
- #log_packet ⇒ Object
- #run_install ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Recorder
Returns a new instance of Recorder.
19 20 21 22 23 |
# File 'lib/evasion-db/recorders/recorders.rb', line 19 def initialize(name,&block) self.instance_eval(&block) @name = name @@recorders << self end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
17 18 19 |
# File 'lib/evasion-db/recorders/recorders.rb', line 17 def name @name end |
Class Method Details
.all ⇒ Object
36 37 38 |
# File 'lib/evasion-db/recorders/recorders.rb', line 36 def self.all @@recorders end |
.by_name(name) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/evasion-db/recorders/recorders.rb', line 40 def self.by_name(name) self.all.each do |recorder| return recorder if recorder.name == name end nil end |
Instance Method Details
#install(&block) ⇒ Object
25 26 27 28 |
# File 'lib/evasion-db/recorders/recorders.rb', line 25 def install(&block) $logger.debug "setting installblock" @install = block end |
#log_packet ⇒ Object
51 52 53 |
# File 'lib/evasion-db/recorders/recorders.rb', line 51 def log_packet raise "overwrite this" end |
#run_install ⇒ Object
30 31 32 33 34 |
# File 'lib/evasion-db/recorders/recorders.rb', line 30 def run_install raise "no install block given" unless @install $logger.debug "run install of #{@name}" @install.call end |
#start ⇒ Object
47 48 49 |
# File 'lib/evasion-db/recorders/recorders.rb', line 47 def start raise "overwrite this" end |