Class: Honker::StreamEvent
- Inherits:
-
Struct
- Object
- Struct
- Honker::StreamEvent
- Defined in:
- lib/honker/stream.rb
Overview
One event in a stream. ‘payload` is already JSON-decoded.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#key ⇒ Object
Returns the value of attribute key.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#payload ⇒ Object
Returns the value of attribute payload.
-
#topic ⇒ Object
Returns the value of attribute topic.
Class Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at
97 98 99 |
# File 'lib/honker/stream.rb', line 97 def created_at @created_at end |
#key ⇒ Object
Returns the value of attribute key
97 98 99 |
# File 'lib/honker/stream.rb', line 97 def key @key end |
#offset ⇒ Object
Returns the value of attribute offset
97 98 99 |
# File 'lib/honker/stream.rb', line 97 def offset @offset end |
#payload ⇒ Object
Returns the value of attribute payload
97 98 99 |
# File 'lib/honker/stream.rb', line 97 def payload @payload end |
#topic ⇒ Object
Returns the value of attribute topic
97 98 99 |
# File 'lib/honker/stream.rb', line 97 def topic @topic end |
Class Method Details
.from_row(row) ⇒ Object
98 99 100 101 102 103 104 105 106 |
# File 'lib/honker/stream.rb', line 98 def self.from_row(row) new( row["offset"], row["topic"], row["key"], row["payload"].nil? ? nil : JSON.parse(row["payload"]), row["created_at"], ) end |