lib/microevent.rb in microevent-1.0.1 vs lib/microevent.rb in microevent-1.0.2
- old
+ new
@@ -1,7 +1,7 @@
module MicroEvent
- VERSION = "1.0.1".freeze
+ VERSION = "1.0.2".freeze
def bind(event, &fn)
@_ ||= Hash.new{ |h,k| h[k] = [] }
fn ? @_[event] << fn : raise(ArgumentError, "no block given")
end
@@ -11,8 +11,8 @@
fn ? @_[event].delete(fn) : @_.delete(event) || []
end
def trigger(event, *args)
@_ ||= Hash.new{ |h,k| h[k] = [] }
- !@_[event].each{ |fn| instance_exec(*args, &fn) }.empty?
+ !@_[event].dup.each{ |fn| instance_exec(*args, &fn) }.empty?
end
end