A
Avdi Grimm
HookR version 1.0.0
by Avdi Grimm
http://hookr.rubyforge.org
== DESCRIPTION
HookR is a publish/subscribe callback hook facility for Ruby.
== CHANGES
* 1 major enhancement
* Birthday!
== SYNOPSIS:
require 'rubygems'
require 'hookr'
class ZeroWing
include HookR::Hooks
define_hook :we_get_signal, :message
def start_game
execute_hookwe_get_signal, "How are you gentlemen?")
end
def bomb(event, message)
puts "somebody set us up the bomb!"
end
we_get_signal do |event, message|
puts "Main screen turn on!"
puts "Cats: #{message}"
end
we_get_signal :bomb
end
zw = ZeroWing.new
zw.we_get_signal do
puts "Take off every zig!"
end
zw.start_game
# >> Main screen turn on!
# >> Cats: How are you gentlemen?
# >> somebody set us up the bomb!
# >> Take off every zig!
--
Avdi
Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com
by Avdi Grimm
http://hookr.rubyforge.org
== DESCRIPTION
HookR is a publish/subscribe callback hook facility for Ruby.
== CHANGES
* 1 major enhancement
* Birthday!
== SYNOPSIS:
require 'rubygems'
require 'hookr'
class ZeroWing
include HookR::Hooks
define_hook :we_get_signal, :message
def start_game
execute_hookwe_get_signal, "How are you gentlemen?")
end
def bomb(event, message)
puts "somebody set us up the bomb!"
end
we_get_signal do |event, message|
puts "Main screen turn on!"
puts "Cats: #{message}"
end
we_get_signal :bomb
end
zw = ZeroWing.new
zw.we_get_signal do
puts "Take off every zig!"
end
zw.start_game
# >> Main screen turn on!
# >> Cats: How are you gentlemen?
# >> somebody set us up the bomb!
# >> Take off every zig!
--
Avdi
Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com