Class: Bread::Manager::Crumbs::TopScope
- Inherits:
-
Object
- Object
- Bread::Manager::Crumbs::TopScope
- Defined in:
- lib/bread/manager/crumbs/top_scope.rb
Instance Method Summary collapse
- #crumb(token, &block) ⇒ Object
- #get_crumb_block(token) ⇒ 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/crumbs/top_scope.rb', line 6 def initialize @crumb_blocks = {} add_devise_support end |
Instance Method Details
#crumb(token, &block) ⇒ Object
11 12 13 14 |
# File 'lib/bread/manager/crumbs/top_scope.rb', line 11 def crumb(token, &block) @crumb_blocks[token] = block true end |
#get_crumb_block(token) ⇒ Object
16 17 18 |
# File 'lib/bread/manager/crumbs/top_scope.rb', line 16 def get_crumb_block(token) @crumb_blocks[token] || raise("no crumb block for: :#{token}") end |