Class: Bread::Manager::Crumbs::TopScope

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

Instance Method Summary collapse

Constructor Details

#initializeTopScope

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