Class: Zuno::SseParser
- Inherits:
-
Object
- Object
- Zuno::SseParser
- Defined in:
- lib/zuno.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize(&on_data) ⇒ SseParser
constructor
A new instance of SseParser.
- #push(chunk) ⇒ Object
Constructor Details
#initialize(&on_data) ⇒ SseParser
Returns a new instance of SseParser.
1969 1970 1971 1972 |
# File 'lib/zuno.rb', line 1969 def initialize(&on_data) @on_data = on_data @buffer = +"" end |
Instance Method Details
#flush ⇒ Object
1981 1982 1983 |
# File 'lib/zuno.rb', line 1981 def flush parse_buffer(final: true) end |
#push(chunk) ⇒ Object
1974 1975 1976 1977 1978 1979 |
# File 'lib/zuno.rb', line 1974 def push(chunk) return if chunk.nil? || chunk.empty? @buffer << chunk parse_buffer end |