lib/rubicure/girl.rb in rubicure-0.2.9 vs lib/rubicure/girl.rb in rubicure-0.3.0

- old
+ new

@@ -53,9 +53,25 @@ print_by_line current_attack_message current_attack_message end + def birthday?(date = Date.today) + return false unless have_birthday? + + # NOTE: birthday is "mm/dd" + month, day = birthday.split("/") + + birthday_date = Date.new(date.year, month.to_i, day.to_i) + + birthday_date == date + end + + def have_birthday? + respond_to?(:birthday) + end + alias_method :has_birthday?, :have_birthday? + class << self attr_writer :sleep_sec # @param girl_name [Symbol] # @return [Rubicure::Girl]