lib/governor/plugin.rb in governor-0.5.2 vs lib/governor/plugin.rb in governor-0.5.3
- old
+ new
@@ -52,10 +52,14 @@
def include_in_model(base) #:nodoc:
instance_exec(base, &@model_callback) if @model_callback
end
+ def include_in_controller(base) #:nodoc:
+ instance_exec(base, &@controller_callback) if @controller_callback
+ end
+
# Evaluates the block in the scope of the model. This is the equivalent of
# creating a mixin, including it within your article class and
# implementing +self.included+.
#
# Example:
@@ -70,9 +74,13 @@
# set_property :delta => true
# end
# end
def register_model_callback(&block)
@model_callback = block
+ end
+
+ def register_controller_callback(&block)
+ @controller_callback = block
end
# Defines mime types that this plugin responds to. These mime types will
# be passed on to the controller.
#
\ No newline at end of file