Class: SSE::StreamEvent
- Inherits:
-
Struct
- Object
- Struct
- SSE::StreamEvent
- Defined in:
- lib/ld-eventsource/events.rb
Overview
Server-Sent Event type used by Client. Use Client#on_event to receive events.
Instance Attribute Summary collapse
-
#data ⇒ String
The string that appeared after ‘data:` in the stream; if there were multiple `data:` lines, they are concatenated with newlines.
-
#id ⇒ String
The string that appeared after ‘id:` in the stream if any, or nil.
-
#type ⇒ Symbol
The string that appeared after ‘event:` in the stream; defaults to `:message` if `event:` was not specified, will never be nil.
Instance Attribute Details
#data ⇒ String
Returns the string that appeared after ‘data:` in the stream; if there were multiple `data:` lines, they are concatenated with newlines.
15 |
# File 'lib/ld-eventsource/events.rb', line 15 StreamEvent = Struct.new(:type, :data, :id) |
#id ⇒ String
Returns the string that appeared after ‘id:` in the stream if any, or nil.
15 |
# File 'lib/ld-eventsource/events.rb', line 15 StreamEvent = Struct.new(:type, :data, :id) |
#type ⇒ Symbol
Returns the string that appeared after ‘event:` in the stream; defaults to `:message` if `event:` was not specified, will never be nil.
15 |
# File 'lib/ld-eventsource/events.rb', line 15 StreamEvent = Struct.new(:type, :data, :id) |