Class: Sqreen::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/sqreen/event.rb

Overview

Master interface for point in time events (e.g. Attack, RemoteException)

Direct Known Subclasses

Attack, RemoteException, RequestRecord

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Event

Returns a new instance of Event.



17
18
19
20
# File 'lib/sqreen/event.rb', line 17

def initialize(payload)
  @payload = payload
  @time = Time.now.utc
end

Instance Attribute Details

#payloadHash (readonly)

Returns:

  • (Hash)


12
13
14
# File 'lib/sqreen/event.rb', line 12

def payload
  @payload
end

#timeTime

Returns:

  • (Time)


15
16
17
# File 'lib/sqreen/event.rb', line 15

def time
  @time
end

Instance Method Details

#to_sObject



22
23
24
# File 'lib/sqreen/event.rb', line 22

def to_s
  "<#{self.class.name}: #{payload.to_hash}>"
end