travis-ci
1 of 1 new or added line in 1 file covered. (100.0%)
201 of 207 relevant lines covered (97.1%)
29.0 hits per line
1 |
module Loaf |
3✔ |
2 |
# A container for breadcrumb values
|
|
3 |
# @api public
|
|
4 |
class Breadcrumb |
3✔ |
5 |
attr_reader :name
|
3✔ |
6 |
|
|
7 |
attr_reader :path
|
3✔ |
8 |
alias url path |
3✔ |
9 |
|
|
10 |
def self.[](*args) |
3✔ |
11 |
new(*args) |
98✔ |
12 |
end
|
|
13 |
|
|
14 |
def initialize(name, path, current) |
3✔ |
15 |
@name = name
|
98✔ |
16 |
@path = path
|
98✔ |
17 |
@current = current
|
98✔ |
18 |
freeze |
98✔ |
19 |
end
|
|
20 |
|
|
21 |
def current? |
3✔ |
22 |
@current
|
60✔ |
23 |
end
|
|
24 |
|
|
25 |
def to_ary |
3✔ |
26 |
[@name, @path, @current] |
52✔ |
27 |
end
|
|
28 |
alias to_a to_ary |
3✔ |
29 |
end # Breadcrumb |
|
30 |
end # Loaf |