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