circleci
30 of 30 new or added lines in 2 files covered. (100.0%)
158 of 159 relevant lines covered (99.37%)
2.97 hits per line
|
class MaybeURI |
1✔ |
|
pattr_initialize :raw_value
|
1✔ |
3 |
|
|
|
def value |
1✔ |
|
if uri?
|
× |
|
uri |
× |
7 |
else
|
|
|
raw_value |
× |
9 |
end
|
|
10 |
end
|
|
11 |
|
|
|
def uri? |
1✔ |
|
String === raw_value && !uri.scheme.blank? && !uri.host.blank?
|
22✔ |
14 |
end
|
|
15 |
|
|
|
private |
1✔ |
17 |
|
|
|
def uri |
1✔ |
|
@uri ||= RDF::URI(raw_value) |
28✔ |
20 |
end
|
|
21 |
end
|