method

years

v5.2.3 - Show latest stable - Class: Integer
years()
public

Returns a Duration instance matching the number of years provided.

2.years # => 2 years