Class: Bread::Manager::Actions::TopScope
- Inherits:
-
Object
- Object
- Bread::Manager::Actions::TopScope
- Defined in:
- lib/bread/manager/actions/top_scope.rb
Instance Method Summary collapse
- #controller(controller_path, options = {}, &block) ⇒ Object
- #get_controller_scope(controller_path) ⇒ Object
-
#initialize ⇒ TopScope
constructor
A new instance of TopScope.
Constructor Details
#initialize ⇒ TopScope
Returns a new instance of TopScope.
6 7 8 9 |
# File 'lib/bread/manager/actions/top_scope.rb', line 6 def initialize @controllers = {} add_devise_support end |
Instance Method Details
#controller(controller_path, options = {}, &block) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/bread/manager/actions/top_scope.rb', line 11 def controller(controller_path, ={}, &block) controller_path = controller_path.to_s @controllers[controller_path] = controller_scope = ControllerScope.new(self, controller_path, ) controller_scope.instance_eval(&block) true end |
#get_controller_scope(controller_path) ⇒ Object
18 19 20 |
# File 'lib/bread/manager/actions/top_scope.rb', line 18 def get_controller_scope(controller_path) @controllers[controller_path.to_s] || raise("no controller #{controller_path} in #{@controllers.keys}") end |