instance method
years
Ruby on Rails 8.0.4
Since v3.0.20Signature
years()
Returns a Duration instance matching the number of years provided.
2.years # => 2 years
Source
# File activesupport/lib/active_support/core_ext/integer/time.rb, line 18
def years
ActiveSupport::Duration.years(self)
end
Defined in activesupport/lib/active_support/core_ext/integer/time.rb line 18
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Integer