Class: Trestle::Breadcrumb::Trail
- Inherits:
-
Object
- Object
- Trestle::Breadcrumb::Trail
- Defined in:
- lib/trestle/breadcrumb.rb
Instance Method Summary collapse
- #append(label, path = nil) ⇒ Object
- #dup ⇒ Object
-
#initialize(breadcrumbs = []) ⇒ Trail
constructor
A new instance of Trail.
- #prepend(label, path = nil) ⇒ Object
Constructor Details
#initialize(breadcrumbs = []) ⇒ Trail
Returns a new instance of Trail.
14 15 16 |
# File 'lib/trestle/breadcrumb.rb', line 14 def initialize(=[]) @breadcrumbs = Array() end |
Instance Method Details
#append(label, path = nil) ⇒ Object
22 23 24 |
# File 'lib/trestle/breadcrumb.rb', line 22 def append(label, path=nil) @breadcrumbs << Breadcrumb.new(label, path) end |
#dup ⇒ Object
18 19 20 |
# File 'lib/trestle/breadcrumb.rb', line 18 def dup self.class.new(@breadcrumbs.dup) end |
#prepend(label, path = nil) ⇒ Object
26 27 28 |
# File 'lib/trestle/breadcrumb.rb', line 26 def prepend(label, path=nil) @breadcrumbs.unshift(Breadcrumb.new(label, path)) end |