Class: Karafka::Core::Monitoring::Event
- Inherits:
-
Object
- Object
- Karafka::Core::Monitoring::Event
- Defined in:
- lib/karafka/core/monitoring/event.rb
Overview
Single notification event wrapping payload with id
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Instance Method Summary collapse
-
#[](name) ⇒ Object
Hash access to the payload data (if present).
-
#initialize(id, payload) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(id, payload) ⇒ Event
Returns a new instance of Event.
12 13 14 15 |
# File 'lib/karafka/core/monitoring/event.rb', line 12 def initialize(id, payload) @id = id @payload = payload end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/karafka/core/monitoring/event.rb', line 8 def id @id end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
8 9 10 |
# File 'lib/karafka/core/monitoring/event.rb', line 8 def payload @payload end |
Instance Method Details
#[](name) ⇒ Object
Hash access to the payload data (if present)
20 21 22 |
# File 'lib/karafka/core/monitoring/event.rb', line 20 def [](name) @payload.fetch(name) end |