travis-ci
10 of 10 new or added lines in 2 files covered. (100.0%)
290 of 304 relevant lines covered (95.39%)
407.32 hits per line
1 |
module Rubicure |
4✔ |
2 |
module Concerns |
4✔ |
3 |
# utility methods
|
|
4 |
module Util |
4✔ |
5 |
# @param arg
|
|
6 |
# @return [Date] arg is String or Date
|
|
7 |
# @return [Time] arg is Time
|
|
8 |
# @return [nil] arg is other
|
|
9 |
def to_date(arg) |
4✔ |
10 |
case arg
|
256✔ |
11 |
when Date, Time |
|
12 |
arg |
116✔ |
13 |
when String |
|
|
begin
|
12✔ |
|
Date.parse(arg)
|
12✔ |
16 |
rescue
|
|
|
nil
|
× |
18 |
end
|
|
19 |
else
|
|
20 |
nil
|
|
21 |
end
|
|
22 |
end
|
|
23 |
end
|
|
24 |
end
|
|
25 |
end
|