Class: Dommy::TransformStreamDefaultController
- Inherits:
-
Object
- Object
- Dommy::TransformStreamDefaultController
- Defined in:
- lib/dommy/streams.rb
Instance Method Summary collapse
- #__js_call__(method, args) ⇒ Object
- #enqueue(chunk) ⇒ Object
- #error(reason) ⇒ Object
-
#initialize(readable) ⇒ TransformStreamDefaultController
constructor
A new instance of TransformStreamDefaultController.
- #terminate ⇒ Object
Constructor Details
#initialize(readable) ⇒ TransformStreamDefaultController
Returns a new instance of TransformStreamDefaultController.
359 360 361 |
# File 'lib/dommy/streams.rb', line 359 def initialize(readable) @readable = readable end |
Instance Method Details
#__js_call__(method, args) ⇒ Object
375 376 377 378 379 380 381 382 383 384 |
# File 'lib/dommy/streams.rb', line 375 def __js_call__(method, args) case method when "enqueue" enqueue(args[0]) when "terminate" terminate when "error" error(args[0]) end end |
#enqueue(chunk) ⇒ Object
363 364 365 |
# File 'lib/dommy/streams.rb', line 363 def enqueue(chunk) @readable.__enqueue__(chunk) end |
#error(reason) ⇒ Object
371 372 373 |
# File 'lib/dommy/streams.rb', line 371 def error(reason) @readable.__error__(reason) end |
#terminate ⇒ Object
367 368 369 |
# File 'lib/dommy/streams.rb', line 367 def terminate @readable.__close__ end |