Skip to content

Instantly share code, notes, and snippets.

@titanous
Created August 16, 2011 21:45
Show Gist options
  • Select an option

  • Save titanous/1150265 to your computer and use it in GitHub Desktop.

Select an option

Save titanous/1150265 to your computer and use it in GitHub Desktop.
def days_in_month(n)
if n == 2 then 28
elsif [4,6,9,11].include?(n) then 30
else 31
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment