lib/jets/turbine.rb in jets-1.3.4 vs lib/jets/turbine.rb in jets-1.3.5
- old
+ new
@@ -1,9 +1,9 @@
module Jets
class Turbine
class_attribute :initializers
- class_attribute :exception_reporters
+ class_attribute :on_exceptions
class << self
def subclasses
@subclasses ||= []
end
@@ -15,12 +15,16 @@
def initializer(label, &block)
self.initializers ||= {}
self.initializers[label] = block
end
+ def on_exception(label, &block)
+ self.on_exceptions ||= {}
+ self.on_exceptions[label] = block
+ end
+
def exception_reporter(label, &block)
- self.exception_reporters ||= {}
- self.exception_reporters[label] = block
+ on_exception(label, &block)
end
end
end
end