From 6b0ff24ee01b03ee71f14f3880214ea94db08cf0 Mon Sep 17 00:00:00 2001 From: James Walker Date: Mon, 15 Oct 2018 23:16:52 -0400 Subject: [PATCH] ruby - leap (2) --- ruby/leap/leap.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ruby/leap/leap.rb b/ruby/leap/leap.rb index abb71e5..d353797 100644 --- a/ruby/leap/leap.rb +++ b/ruby/leap/leap.rb @@ -1,5 +1,6 @@ +# Year class class Year def self.leap?(year) - (year % 4 == 0 and (year % 400 == 0 or year % 100 != 0)) + ((year % 4).zero? && ((year % 400).zero? || year % 100 != 0)) end end