ruby - leap (2)

This commit is contained in:
James Walker 2018-10-15 23:16:52 -04:00
parent 113fa6679b
commit 6b0ff24ee0
Signed by: walkah
GPG Key ID: 3C127179D6086E93

View File

@ -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