Class: Vangrail::AuditEvent
- Inherits:
-
Object
- Object
- Vangrail::AuditEvent
- Defined in:
- lib/vangrail/audit.rb
Overview
Immutable structured event emitted by enforcement operations.
Instance Attribute Summary collapse
-
#at ⇒ Object
readonly
Returns the value of attribute at.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(id:, type:, timestamp:, data:) ⇒ AuditEvent
constructor
A new instance of AuditEvent.
- #to_h ⇒ Object
Constructor Details
#initialize(id:, type:, timestamp:, data:) ⇒ AuditEvent
Returns a new instance of AuditEvent.
12 13 14 15 16 17 18 |
# File 'lib/vangrail/audit.rb', line 12 def initialize(id:, type:, timestamp:, data:) @id = id.to_s.freeze @type = type.to_sym @at = .to_s.freeze @data = data.freeze freeze end |
Instance Attribute Details
#at ⇒ Object (readonly)
Returns the value of attribute at.
10 11 12 |
# File 'lib/vangrail/audit.rb', line 10 def at @at end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/vangrail/audit.rb', line 10 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/vangrail/audit.rb', line 10 def id @id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/vangrail/audit.rb', line 10 def type @type end |
Instance Method Details
#to_h ⇒ Object
20 21 22 |
# File 'lib/vangrail/audit.rb', line 20 def to_h { 'id' => id, 'type' => type.to_s, 'at' => at, 'data' => data } end |