lib/bushido/envs.rb in bushido-0.0.25 vs lib/bushido/envs.rb in bushido-0.0.26
- old
+ new
@@ -2,23 +2,23 @@
class Envs #:nodoc:
@@hooks = {}
class << self
- def fire *hooks
+ def fire(data, *hooks)
unless @@hooks[:global].nil?
- @@hooks[:global].call('global')
+ @@hooks[:global].call(data, 'global')
end
-
+
if hooks.length > 0
hooks.each do |h|
unless @@hooks[h].nil?
- @@hooks[h].call(h, data)
+ @@hooks[h].call(data, hook)
end
end
end
end
-
+
def listen *hooks, &block
if hooks.empty? and block_given?
@@hooks[:global] = block
elsif !hooks.nil? and block_given?
hooks.each do |h|
\ No newline at end of file