1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
12 data.each_key do |key|
33 def observe(event, &blk)
34 obs = SimpleObserver.new(event, &blk)
36 # return observer so that we can remove it later
42 notify_observers any_to_event(e)
55 def initialize(event, &blk)
61 if data.has_key?(@event)
81 def metaclass_eval(&blk)
82 metaclass.instance_eval(&blk)