Skip to content

Instantly share code, notes, and snippets.

@luckyruby
Created March 2, 2012 06:56
Show Gist options
  • Save luckyruby/1956339 to your computer and use it in GitHub Desktop.
Save luckyruby/1956339 to your computer and use it in GitHub Desktop.
def self.valid_time?(time)
time.length == 4 && time =~ /[0-2][0-9][0-5][0-9]/ && time.to_i <= 2359
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment