Class: Dommy::AbortController
- Inherits:
-
Object
- Object
- Dommy::AbortController
- Defined in:
- lib/dommy/event.rb
Constant Summary collapse
- JS_METHOD_NAMES =
Methods routed through js_call (keep in sync with its when-arms).
%w[abort].freeze
Instance Attribute Summary collapse
-
#signal ⇒ Object
readonly
Returns the value of attribute signal.
Instance Method Summary collapse
- #__js_call__(method, args) ⇒ Object
- #__js_get__(key) ⇒ Object
- #__js_method_names__ ⇒ Object
- #__js_set__(_key, _value) ⇒ Object
-
#initialize ⇒ AbortController
constructor
A new instance of AbortController.
Constructor Details
#initialize ⇒ AbortController
Returns a new instance of AbortController.
970 971 972 |
# File 'lib/dommy/event.rb', line 970 def initialize @signal = AbortSignal.new end |
Instance Attribute Details
#signal ⇒ Object (readonly)
Returns the value of attribute signal.
968 969 970 |
# File 'lib/dommy/event.rb', line 968 def signal @signal end |
Instance Method Details
#__js_call__(method, args) ⇒ Object
988 989 990 991 992 993 |
# File 'lib/dommy/event.rb', line 988 def __js_call__(method, args) case method when "abort" @signal.__internal_mark_aborted__(args[0]) end end |
#__js_get__(key) ⇒ Object
974 975 976 |
# File 'lib/dommy/event.rb', line 974 def __js_get__(key) @signal if key == "signal" end |
#__js_method_names__ ⇒ Object
984 985 986 |
# File 'lib/dommy/event.rb', line 984 def __js_method_names__ JS_METHOD_NAMES end |
#__js_set__(_key, _value) ⇒ Object
978 979 980 |
# File 'lib/dommy/event.rb', line 978 def __js_set__(_key, _value) nil end |