instance method
Date#prev_year
(?::Integer year) -> ::Date
prev_year(n = 1) → new_date
ext/date/date_core.c
View on GitHub ↗
static VALUE
d_lite_prev_year(int argc, VALUE *argv, VALUE self)
{
VALUE n;
rb_scan_args(argc, argv, "01", &n);
if (argc < 1)
n = INT2FIX(1);
return d_lite_lshift(self, f_mul(n, INT2FIX(12)));
}
Equivalent to << with argument n * 12.