class Duration
Ruby on Rails 7.1.6
Since v2.2.3Active Support Duration
Provides accurate date and time measurements using Date#advance and Time#advance, respectively. It mainly supports the methods on Numeric.
1.month.ago # equivalent to Time.now.advance(months: -1)
Inherits from
Namespace
Classes
Constants
- ActiveSupport::Duration::PARTS
- ActiveSupport::Duration::PARTS_IN_SECONDS
- ActiveSupport::Duration::SECONDS_PER_DAY
- ActiveSupport::Duration::SECONDS_PER_HOUR
- ActiveSupport::Duration::SECONDS_PER_MINUTE
- ActiveSupport::Duration::SECONDS_PER_MONTH
- ActiveSupport::Duration::SECONDS_PER_WEEK
- ActiveSupport::Duration::SECONDS_PER_YEAR
- ActiveSupport::Duration::VARIABLE_PARTS
Attributes
Methods (defined here)
Private methods
(5)
Implementation detail — not part of the public API.
Methods (inherited)
From Object (17)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with
- # with_options