Class: Para::Breadcrumbs::Manager

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/para/breadcrumbs/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ Manager

Returns a new instance of Manager.



10
11
12
# File 'lib/para/breadcrumbs/manager.rb', line 10

def initialize(controller)
  @controller = controller
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



6
7
8
# File 'lib/para/breadcrumbs/manager.rb', line 6

def controller
  @controller
end

Instance Method Details

#add(identifier, path = nil, *args) ⇒ Object



14
15
16
# File 'lib/para/breadcrumbs/manager.rb', line 14

def add(identifier, path = nil, *args)
  breadcrumbs << Breadcrumb.new(identifier, path, controller, *args)
end


18
19
20
# File 'lib/para/breadcrumbs/manager.rb', line 18

def breadcrumbs
  @breadcrumbs ||= []
end

#each(&block) ⇒ Object



22
23
24
# File 'lib/para/breadcrumbs/manager.rb', line 22

def each(&block)
  breadcrumbs.each(&block)
end