Sha256: 9b0c360e42bcf5eec6144b4244fd423916b72a9c72b3c3a6523dc2aa505c4165
Contents?: true
Size: 452 Bytes
Versions: 8
Compression:
Stored size: 452 Bytes
Contents
module Wx class EvtHandler def register_for_message(message, method = nil, &block) raise "Must pass method or block" unless block || method block ||= Proc.new {|*args| self.send(method, *args)} @@message_blocks ||= {} @@message_blocks[message] ||= [] @@message_blocks[message] << block end def send_message(message, *args) blocks = @@message_blocks[message] || [] blocks.each {|block| block.call(*args)} end end end
Version data entries
8 entries across 8 versions & 1 rubygems