repl.it
@marksiemers1/LeapYearOverloads
Ruby

No description

main.rb
require "date"

module Year
  def self.leap?(input)
    if input.is_a? Integer 
      input % 400 == 0 || (input % 100 != 0 && input % 4 == 0)
    elsif input.is_a? Date
      input.leap?
    else
      raise ArgumentError.new("must pass an Integer or Date.")
    end
  end
end

puts Year.leap?(2016)
puts Year.leap?(Date.new(2016,1,1))
puts Year.leap?("2016")
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]