ruby - leap (2)
This commit is contained in:
parent
113fa6679b
commit
6b0ff24ee0
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user