update rankings date update parsing logic.
This commit is contained in:
parent
534f993864
commit
f3bdbfb282
|
@ -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>]
|
||||
|
|
Loading…
Reference in New Issue