Class: Bro::Event
Instance Attribute Summary collapse
-
#ev ⇒ Object
readonly
Returns the value of attribute ev.
Instance Method Summary collapse
-
#initialize(name) ⇒ Event
constructor
A new instance of Event.
-
#insert(value, type, type_name = nil) ⇒ Object
Insert a value into an event.
Constructor Details
#initialize(name) ⇒ Event
Returns a new instance of Event.
7 8 9 10 11 |
# File 'lib/Bro/event.rb', line 7 def initialize(name) @ev = bro_event_new(name) # Kill the BroEvent when the ruby object is garbage collected ObjectSpace.define_finalizer(self, Event.create_finalizer(@ev)) end |
Instance Attribute Details
#ev ⇒ Object (readonly)
Returns the value of attribute ev.
5 6 7 |
# File 'lib/Bro/event.rb', line 5 def ev @ev end |
Instance Method Details
#insert(value, type, type_name = nil) ⇒ Object
Insert a value into an event.
14 15 16 17 |
# File 'lib/Bro/event.rb', line 14 def insert(value, type, type_name=nil) value = value.rec if type == :record bro_event_add_val(@ev, [Bro::TYPES[type], type_name, value]) end |