Class: Webtask::StreamError
- Inherits:
-
Object
- Object
- Webtask::StreamError
- Defined in:
- lib/webtask/stream_error.rb
Instance Method Summary collapse
- #errors? ⇒ Boolean
-
#initialize(stream) ⇒ StreamError
constructor
A new instance of StreamError.
- #write(data) ⇒ Object
Constructor Details
#initialize(stream) ⇒ StreamError
Returns a new instance of StreamError.
3 4 5 6 |
# File 'lib/webtask/stream_error.rb', line 3 def initialize(stream) @stream = stream @errors = false end |
Instance Method Details
#errors? ⇒ Boolean
8 9 10 |
# File 'lib/webtask/stream_error.rb', line 8 def errors? @errors end |
#write(data) ⇒ Object
12 13 14 15 16 |
# File 'lib/webtask/stream_error.rb', line 12 def write(data) @errors = true @stream << "event: stderr\n" @stream << "data: #{data}\n\n" end |