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
# File 'lib/bread/manager/crumbs/top_scope.rb', line 6

def initialize
  @crumb_blocks = {}
end

Instance Method Details

#crumb(token, &block) ⇒ Object



10
11
12
13
# File 'lib/bread/manager/crumbs/top_scope.rb', line 10

def crumb(token, &block)
  @crumb_blocks[token] = block
  true
end

#get_crumb_block(token) ⇒ Object



15
16
17
# File 'lib/bread/manager/crumbs/top_scope.rb', line 15

def get_crumb_block(token)
  @crumb_blocks[token] || raise("no crumb block for: :#{token}")
end