Permalink
Browse files

refactor current week to be a little easier on the eyes.

  • Loading branch information...
1 parent 063f679 commit 6bdfdbabaadf7cc98ee694b708654f36d6986a53 @cjolly committed Jan 5, 2013
Showing with 3 additions and 7 deletions.
  1. +3 −7 lib/pickem.rb
View
@@ -21,13 +21,9 @@ def self.results
end
def self.current_week(today = Date.today)
- week_of_year = today.cweek
- if today.cweek < FIRST_WEEK_OF_SEASON
- week = today.cweek + 52 - FIRST_WEEK_OF_SEASON
- else
- week = today.cweek - FIRST_WEEK_OF_SEASON
- end
- week += 1 unless today.monday?
+ week = today.cweek - FIRST_WEEK_OF_SEASON
+ week += 52 if week < 0
+ week += 1 unless today.monday?
week
end
end

0 comments on commit 6bdfdba

Please sign in to comment.