Skip to content

Instantly share code, notes, and snippets.

@ecleel
Created January 8, 2015 13:10
Show Gist options
  • Save ecleel/b23fa85ec3cadf91ecee to your computer and use it in GitHub Desktop.
Save ecleel/b23fa85ec3cadf91ecee to your computer and use it in GitHub Desktop.
Season Function
require 'date'
def season(date)
case date.yday
when 80..202 then "Spring"
when 203..264 then "Summer"
when 265..355 then "Autumn"
else
"Winter"
end
end
puts season(Date.today)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment