Class: Bread::Manager::Actions::TopScope

Inherits:
Object
  • Object
show all
Defined in:
lib/bread/manager/actions/top_scope.rb

Instance Method Summary collapse

Constructor Details

#initializeTopScope

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, options={}, &block)
  controller_path = controller_path.to_s
  @controllers[controller_path] = controller_scope = ControllerScope.new(self, controller_path, options)
  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