class Faker::Date

def birthday(legacy_min_age = NOT_GIVEN, legacy_max_age = NOT_GIVEN, min_age: 18, max_age: 65)

Returns:
  • (Date) -

Parameters:
  • max_age (Integer) -- The maximum age that the birthday would imply.
  • min_age (Integer) -- The minimum age that the birthday would imply.
def birthday(legacy_min_age = NOT_GIVEN, legacy_max_age = NOT_GIVEN, min_age: 18, max_age: 65)
  warn_for_deprecated_arguments do |keywords|
    keywords << :min_age if legacy_min_age != NOT_GIVEN
  end
  warn_for_deprecated_arguments do |keywords|
    keywords << :max_age if legacy_max_age != NOT_GIVEN
  end
  t = ::Date.today
  from = birthday_date(t, max_age)
  to   = birthday_date(t, min_age)
  between(from: from, to: to).to_date
end