Class: Spikard::Testing::InlineSseEvent
- Inherits:
-
Object
- Object
- Spikard::Testing::InlineSseEvent
- Defined in:
- lib/spikard/testing.rb
Overview
Lightweight wrapper for parsed SSE events backed by strings.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(data) ⇒ InlineSseEvent
constructor
A new instance of InlineSseEvent.
Constructor Details
#initialize(data) ⇒ InlineSseEvent
Returns a new instance of InlineSseEvent.
279 280 281 |
# File 'lib/spikard/testing.rb', line 279 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
277 278 279 |
# File 'lib/spikard/testing.rb', line 277 def data @data end |
Instance Method Details
#as_json ⇒ Object
283 284 285 |
# File 'lib/spikard/testing.rb', line 283 def as_json JSON.parse(@data) end |