Class: Dommy::TransformStreamDefaultController

Inherits:
Object
  • Object
show all
Defined in:
lib/dommy/streams.rb

Instance Method Summary collapse

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

#terminateObject



367
368
369
# File 'lib/dommy/streams.rb', line 367

def terminate
  @readable.__close__
end