Methods
Public Instance methods
Alias for months
This method is also aliased as
month
[ show source ]
# File activesupport/lib/active_support/core_ext/float/time.rb, line 10 10: def months 11: ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:months, "Fractional months are not respected. Convert value to integer before calling #months."), caller) 12: months_without_deprecation 13: end
[ show source ]
# File activesupport/lib/active_support/core_ext/float/time.rb, line 15 15: def months_without_deprecation 16: ActiveSupport::Duration.new(self * 30.days, [[:months, self]]) 17: end
Alias for years
Deprication helper methods not available as core_ext is loaded first.
This method is also aliased as
year
[ show source ]
# File activesupport/lib/active_support/core_ext/float/time.rb, line 6 6: def years 7: ::ActiveSupport::Deprecation.warn(self.class.deprecated_method_warning(:years, "Fractional years are not respected. Convert value to integer before calling #years."), caller) 8: years_without_deprecation 9: end
[ show source ]
# File activesupport/lib/active_support/core_ext/float/time.rb, line 20 20: def years_without_deprecation 21: ActiveSupport::Duration.new(self * 365.25.days, [[:years, self]]) 22: end