Class: Browser::Event::Target::Delegate
- Defined in:
- opal/browser/event/base.rb
Instance Method Summary collapse
-
#initialize(target, name, pair) ⇒ Delegate
constructor
A new instance of Delegate.
-
#off ⇒ Object
Stop listening for the event linked to the delegate.
Constructor Details
#initialize(target, name, pair) ⇒ Delegate
Returns a new instance of Delegate.
111 112 113 114 115 |
# File 'opal/browser/event/base.rb', line 111 def initialize(target, name, pair) @target = target @name = name @pair = pair end |
Instance Method Details
#off ⇒ Object
Stop listening for the event linked to the delegate.
118 119 120 121 122 123 124 125 126 |
# File 'opal/browser/event/base.rb', line 118 def off delegate = @target.delegated[@name] delegate.last.delete(@pair) if delegate.last.empty? delegate.first.off delegate.delete(@name) end end |