Merge pull request #50810 from m-nakamura145/activesupport/duration-parts-example

Add example to parts documentation [ci-skip]
This commit is contained in:
Petrik de Heus 2024-01-19 15:10:24 +01:00 committed by GitHub
commit 25d03be267
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -234,7 +234,10 @@ module ActiveSupport
end
end
# Returns a copy of the parts hash that defines the duration
# Returns a copy of the parts hash that defines the duration.
#
# 5.minutes.parts # => {:minutes=>5}
# 3.years.parts # => {:years=>3}
def parts
@parts.dup
end