lib/stance.rb in stance-0.2.0 vs lib/stance.rb in stance-0.3.0
- old
+ new
@@ -4,9 +4,19 @@
require 'stance/engine'
module Stance
class EventNotFound < StandardError; end
+ mattr_accessor :disabled_events
+ @@disabled_events = []
+
+ def self.disable(*events)
+ disabled_events.concat events
+ yield
+ ensure
+ self.disabled_events -= events
+ end
+
autoload :Events, 'stance/events'
autoload :Event, 'stance/event'
autoload :Eventable, 'stance/eventable'
end