Class: Dommy::TransformStreamDefaultController

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

Instance Method Summary collapse

Methods included from Bridge::Methods

included

Constructor Details

#initialize(readable) ⇒ TransformStreamDefaultController

Returns a new instance of TransformStreamDefaultController.



348
349
350
# File 'lib/dommy/streams.rb', line 348

def initialize(readable)
  @readable = readable
end

Instance Method Details

#__js_call__(method, args) ⇒ Object



366
367
368
369
370
371
372
373
374
375
# File 'lib/dommy/streams.rb', line 366

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



352
353
354
# File 'lib/dommy/streams.rb', line 352

def enqueue(chunk)
  @readable.__internal_enqueue__(chunk)
end

#error(reason) ⇒ Object



360
361
362
# File 'lib/dommy/streams.rb', line 360

def error(reason)
  @readable.__internal_error__(reason)
end

#terminateObject



356
357
358
# File 'lib/dommy/streams.rb', line 356

def terminate
  @readable.__internal_close__
end