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.
-
#last_event_id ⇒ String
The ‘id:` value that was most recently seen in an event from this stream; this differs from the `id` property in that it retains the same value in subsequent events if they do not provide their own `id:`.
-
#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.
19 |
# File 'lib/ld-eventsource/events.rb', line 19 StreamEvent = Struct.new(:type, :data, :id, :last_event_id) |
#id ⇒ String
Returns the string that appeared after ‘id:` in the stream if any, or nil.
19 |
# File 'lib/ld-eventsource/events.rb', line 19 StreamEvent = Struct.new(:type, :data, :id, :last_event_id) |
#last_event_id ⇒ String
Returns the ‘id:` value that was most recently seen in an event from this stream; this differs from the `id` property in that it retains the same value in subsequent events if they do not provide their own `id:`.
19 |
# File 'lib/ld-eventsource/events.rb', line 19 StreamEvent = Struct.new(:type, :data, :id, :last_event_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.
19 |
# File 'lib/ld-eventsource/events.rb', line 19 StreamEvent = Struct.new(:type, :data, :id, :last_event_id) |