Class: Smplkit::Audit::AuditEvent
- Inherits:
-
Struct
- Object
- Struct
- Smplkit::Audit::AuditEvent
- Defined in:
- lib/smplkit/audit/events.rb
Overview
Public-facing audit event resource. ADR-047 ยง2.3.1.
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#actor_id ⇒ Object
Returns the value of attribute actor_id.
-
#actor_label ⇒ Object
Returns the value of attribute actor_label.
-
#actor_type ⇒ Object
Returns the value of attribute actor_type.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key.
-
#occurred_at ⇒ Object
Returns the value of attribute occurred_at.
-
#resource_id ⇒ Object
Returns the value of attribute resource_id.
-
#resource_type ⇒ Object
Returns the value of attribute resource_type.
-
#snapshot ⇒ Object
Returns the value of attribute snapshot.
Class Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def action @action end |
#actor_id ⇒ Object
Returns the value of attribute actor_id
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def actor_id @actor_id end |
#actor_label ⇒ Object
Returns the value of attribute actor_label
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def actor_label @actor_label end |
#actor_type ⇒ Object
Returns the value of attribute actor_type
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def actor_type @actor_type end |
#created_at ⇒ Object
Returns the value of attribute created_at
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def created_at @created_at end |
#data ⇒ Object
Returns the value of attribute data
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def data @data end |
#id ⇒ Object
Returns the value of attribute id
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def id @id end |
#idempotency_key ⇒ Object
Returns the value of attribute idempotency_key
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def idempotency_key @idempotency_key end |
#occurred_at ⇒ Object
Returns the value of attribute occurred_at
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def occurred_at @occurred_at end |
#resource_id ⇒ Object
Returns the value of attribute resource_id
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def resource_id @resource_id end |
#resource_type ⇒ Object
Returns the value of attribute resource_type
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def resource_type @resource_type end |
#snapshot ⇒ Object
Returns the value of attribute snapshot
96 97 98 |
# File 'lib/smplkit/audit/events.rb', line 96 def snapshot @snapshot end |
Class Method Details
.from_resource(resource) ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/smplkit/audit/events.rb', line 103 def self.from_resource(resource) attrs = resource.attributes new( id: resource.id, action: attrs.action, resource_type: attrs.resource_type, resource_id: attrs.resource_id, occurred_at: attrs.occurred_at, created_at: attrs.created_at, actor_type: attrs.actor_type, actor_id: attrs.actor_id, actor_label: attrs.actor_label, snapshot: attrs.snapshot, data: attrs.data || {}, idempotency_key: attrs.idempotency_key ) end |