Class: Hey::Pubsub::Event
- Inherits:
-
Object
- Object
- Hey::Pubsub::Event
- Defined in:
- lib/hey/pubsub/event.rb
Instance Method Summary collapse
-
#initialize(name:, uuid:, started_at:, ended_at:, metadata: {}) ⇒ Event
constructor
A new instance of Event.
- #to_hash ⇒ Object
Constructor Details
#initialize(name:, uuid:, started_at:, ended_at:, metadata: {}) ⇒ Event
Returns a new instance of Event.
2 3 4 5 6 7 8 |
# File 'lib/hey/pubsub/event.rb', line 2 def initialize(name:, uuid:, started_at:, ended_at:, metadata: {}) @name = name @uuid = uuid @started_at = started_at @ended_at = ended_at = end |
Instance Method Details
#to_hash ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/hey/pubsub/event.rb', line 10 def to_hash { uuid: uuid, name: name, started_at: started_at, ended_at: ended_at, duration: duration, metadata: } end |