method

years

rails latest stable - Class: Integer
years()
public

Returns a Duration instance matching the number of years provided.

2.years # => 2 years