Class: Conductor::Worker::Events::ConductorEvent
- Inherits:
-
Object
- Object
- Conductor::Worker::Events::ConductorEvent
- Defined in:
- lib/conductor/worker/events/conductor_event.rb
Overview
Base class for all Conductor events Provides a timestamp for when the event occurred
Direct Known Subclasses
HttpApiRequest, TaskRunnerEvent, ThreadUncaughtException, WorkflowEvent
Instance Attribute Summary collapse
-
#timestamp ⇒ Time
readonly
UTC timestamp when event was created.
Instance Method Summary collapse
-
#initialize ⇒ ConductorEvent
constructor
A new instance of ConductorEvent.
-
#to_h ⇒ Hash
Event as a hash for serialization.
Constructor Details
#initialize ⇒ ConductorEvent
Returns a new instance of ConductorEvent.
12 13 14 |
# File 'lib/conductor/worker/events/conductor_event.rb', line 12 def initialize @timestamp = Time.now.utc end |
Instance Attribute Details
#timestamp ⇒ Time (readonly)
Returns UTC timestamp when event was created.
10 11 12 |
# File 'lib/conductor/worker/events/conductor_event.rb', line 10 def @timestamp end |
Instance Method Details
#to_h ⇒ Hash
Returns Event as a hash for serialization.
17 18 19 |
# File 'lib/conductor/worker/events/conductor_event.rb', line 17 def to_h { timestamp: @timestamp.iso8601(3) } end |