Completed
Push — master ( e348e7...94d493 )
by Yoh
57s
created

EventTarget.on()   A

Complexity

Conditions 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
1
module Hyalite::DOM
2
  module EventTarget
3
    def on(name, &block)
4
      callback = Proc.new{|event| block.call(Event.create(event))}
5
      `#@native.addEventListener(name, callback)`
6
    end
7
  end
8
end
9