class Duration
Ruby on Rails 5.1.7
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
Attributes
Methods (defined here)
Private methods (4)
Show private methods Implementation detail — not part of the public API.
- # method_missing
- # raise_type_error
- # sum
- self. calculate_total_seconds
Methods (inherited)
From Object
(25)
- # <
- # acts_like?
- # blank?
- # change
- # create_fixtures
- # deep_dup
- # destroy
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # perform
- # presence
- # presence_in
- # present?
- # subscribed
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # unsubscribed
- # with_options
- self. table_name_prefix