Class: Loaf::Breadcrumb
- Inherits:
-
Object
- Object
- Loaf::Breadcrumb
- Defined in:
- lib/loaf/breadcrumb.rb
Overview
A container for breadcrumb values
Instance Attribute Summary collapse
- #name ⇒ Object readonly
- #path ⇒ Object (also: #url) readonly
Class Method Summary collapse
Instance Method Summary collapse
- #current? ⇒ Boolean
-
#initialize(name, path, current) ⇒ Breadcrumb
constructor
A new instance of Breadcrumb.
- #to_ary ⇒ Object (also: #to_a)
Constructor Details
#initialize(name, path, current) ⇒ Breadcrumb
Returns a new instance of Breadcrumb.
14 15 16 17 18 19 |
# File 'lib/loaf/breadcrumb.rb', line 14 def initialize(name, path, current) @name = name @path = path @current = current freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
5 6 7 |
# File 'lib/loaf/breadcrumb.rb', line 5 def name @name end |
#path ⇒ Object (readonly) Also known as: url
7 8 9 |
# File 'lib/loaf/breadcrumb.rb', line 7 def path @path end |
Class Method Details
.[](*args) ⇒ Object
10 11 12 |
# File 'lib/loaf/breadcrumb.rb', line 10 def self.[](*args) new(*args) end |
Instance Method Details
#current? ⇒ Boolean
21 22 23 |
# File 'lib/loaf/breadcrumb.rb', line 21 def current? @current end |
#to_ary ⇒ Object Also known as: to_a
25 26 27 |
# File 'lib/loaf/breadcrumb.rb', line 25 def to_ary [@name, @path, @current] end |