update rankings date update parsing logic.
This commit is contained in:
parent
534f993864
commit
f3bdbfb282
|
@ -32,11 +32,14 @@ module Ncaa
|
||||||
|
|
||||||
# @return [Time]
|
# @return [Time]
|
||||||
def last_updated
|
def last_updated
|
||||||
@last_updated ||= begin
|
@last_updated ||=
|
||||||
updated = html.css('figure.rankings-last-updated').text
|
begin
|
||||||
date = updated[/\w+{3,}\.? \d+{1,2}, \d+{2,4}/]
|
updated = html.css('figure.rankings-last-updated').text
|
||||||
Time.parse(date)
|
date = updated[/\w+{3,}\.? \d+{1,2}\,? \d+{2,4}/]
|
||||||
end
|
Time.parse(date)
|
||||||
|
rescue TypeError
|
||||||
|
nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# @return [Array<Hash>]
|
# @return [Array<Hash>]
|
||||||
|
|
Loading…
Reference in New Issue