Class: BreadCrumb
- Inherits:
-
Object
- Object
- BreadCrumb
- Includes:
- Enumerable
- Defined in:
- lib/lokka/bread_crumb.rb
Instance Attribute Summary collapse
-
#breads ⇒ Object
Returns the value of attribute breads.
Instance Method Summary collapse
- #add(name, link) ⇒ Object
- #each ⇒ Object
-
#initialize(breads = []) ⇒ BreadCrumb
constructor
A new instance of BreadCrumb.
Constructor Details
#initialize(breads = []) ⇒ BreadCrumb
Returns a new instance of BreadCrumb.
19 20 21 22 |
# File 'lib/lokka/bread_crumb.rb', line 19 def initialize(breads = []) @breads = breads end |
Instance Attribute Details
#breads ⇒ Object
Returns the value of attribute breads.
17 18 19 |
# File 'lib/lokka/bread_crumb.rb', line 17 def breads @breads end |
Instance Method Details
#add(name, link) ⇒ Object
24 25 26 |
# File 'lib/lokka/bread_crumb.rb', line 24 def add(name, link) @breads << Bread.new(name, link) end |
#each ⇒ Object
28 29 30 31 32 33 |
# File 'lib/lokka/bread_crumb.rb', line 28 def each @breads.last.last = true @breads.each do |bread| yield bread end end |