Class: Browser::Event::Custom
- Inherits:
-
Browser::Event
- Object
- Browser::Event
- Browser::Event::Custom
- Defined in:
- opal/browser/event/custom.rb
Defined Under Namespace
Classes: Definition
Instance Attribute Summary
Attributes inherited from Browser::Event
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event, callback = nil) ⇒ Custom
constructor
A new instance of Custom.
- #method_missing(id) ⇒ Object
Methods inherited from Browser::Event
aliases, #arguments, #arguments=, class_for, create, #name, name_for, new, #off, #prevent, #prevented?, #stop, #stop!, #stopped?, #target
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(id) ⇒ Object
58 59 60 61 62 |
# File 'opal/browser/event/custom.rb', line 58 def method_missing(id, *) return @detail[id] if @detail.has_key?(id) super end |
Class Method Details
.construct(name, desc) ⇒ Object
19 20 21 22 23 24 |
# File 'opal/browser/event/custom.rb', line 19 def self.construct(name, desc) `new CustomEvent(name, { bubbles: desc.bubbles, cancelable: desc.cancelable, detail: desc })` end |