update rankings date update parsing logic.

This commit is contained in:
ZippyDev 2020-01-20 11:49:19 -07:00
parent 534f993864
commit f3bdbfb282
1 changed files with 8 additions and 5 deletions

View File

@ -32,11 +32,14 @@ module Ncaa
# @return [Time]
def last_updated
@last_updated ||= begin
updated = html.css('figure.rankings-last-updated').text
date = updated[/\w+{3,}\.? \d+{1,2}, \d+{2,4}/]
Time.parse(date)
end
@last_updated ||=
begin
updated = html.css('figure.rankings-last-updated').text
date = updated[/\w+{3,}\.? \d+{1,2}\,? \d+{2,4}/]
Time.parse(date)
rescue TypeError
nil
end
end
# @return [Array<Hash>]