Class: Dommy::AbortController

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAbortController

Returns a new instance of AbortController.



570
571
572
# File 'lib/dommy/event.rb', line 570

def initialize
  @signal = AbortSignal.new
end

Instance Attribute Details

#signalObject (readonly)

Returns the value of attribute signal.



568
569
570
# File 'lib/dommy/event.rb', line 568

def signal
  @signal
end

Instance Method Details

#__js_call__(method, args) ⇒ Object



582
583
584
585
586
587
# File 'lib/dommy/event.rb', line 582

def __js_call__(method, args)
  case method
  when "abort"
    @signal.__mark_aborted__(args[0])
  end
end

#__js_get__(key) ⇒ Object



574
575
576
# File 'lib/dommy/event.rb', line 574

def __js_get__(key)
  @signal if key == "signal"
end

#__js_set__(_key, _value) ⇒ Object



578
579
580
# File 'lib/dommy/event.rb', line 578

def __js_set__(_key, _value)
  nil
end