#
# On Windows, the class `Time' cannot express time before 1970.1.1.
# This class use Date instead of Time
#

require("date")

class Human
    def initialize (name, year, month, day)
	@name = name
	@birth_day = Date.new(year, month, day)
    end

    def name
	return @name
    end

    def age
	today = Date.today
	a = today.year - @birth_day.year
	if today.mon < @birth_day.mon
	    a = a - 1
	elsif today.mon == @birth_day.mon
	    if today.day < @birth_day.day
		a = a - 1
	    end
	end
	return a
    end
end
