Class: Dommy::EventTarget::Listener

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

Instance Method Summary collapse

Instance Method Details

#capture?Boolean

useCapture: a boolean third argument, or ‘…` in the options dictionary. A capture listener fires in the capturing phase; a non-capture listener in the bubbling phase (both at the target).

Returns:

  • (Boolean)


163
164
165
# File 'lib/dommy/event.rb', line 163

def capture?
  EventTarget.capture_flag(options)
end

#once?Boolean

Returns:

  • (Boolean)


151
152
153
154
155
156
157
158
# File 'lib/dommy/event.rb', line 151

def once?
  case options
  when Hash
    options["once"] || options[:once]
  else
    false
  end
end