Class: Igniter::Extensions::Contracts::Audit::Event
- Inherits:
-
Object
- Object
- Igniter::Extensions::Contracts::Audit::Event
- Defined in:
- lib/igniter/extensions/contracts/audit/event.rb
Instance Attribute Summary collapse
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(event_id:, type:, node_name:, path:, status:, payload: {}) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
Constructor Details
#initialize(event_id:, type:, node_name:, path:, status:, payload: {}) ⇒ Event
Returns a new instance of Event.
10 11 12 13 14 15 16 17 18 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 10 def initialize(event_id:, type:, node_name:, path:, status:, payload: {}) @event_id = event_id.to_s @type = type.to_sym @node_name = node_name.to_sym @path = Array(path).map(&:to_sym).freeze @status = status.to_sym @payload = payload.freeze freeze end |
Instance Attribute Details
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
8 9 10 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 8 def event_id @event_id end |
#node_name ⇒ Object (readonly)
Returns the value of attribute node_name.
8 9 10 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 8 def node_name @node_name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 8 def path @path end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
8 9 10 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 8 def payload @payload end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 8 def status @status end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 8 def type @type end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/igniter/extensions/contracts/audit/event.rb', line 20 def to_h { event_id: event_id, type: type, node_name: node_name, path: path, status: status, payload: payload } end |