Skip to content

Commit 25d03be

Browse files
authored
Merge pull request rails#50810 from m-nakamura145/activesupport/duration-parts-example
Add example to parts documentation [ci-skip]
2 parents 44ef49c + a5af0a9 commit 25d03be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

activesupport/lib/active_support/duration.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ def initialize(value, parts, variable = nil) # :nodoc:
234234
end
235235
end
236236

237-
# Returns a copy of the parts hash that defines the duration
237+
# Returns a copy of the parts hash that defines the duration.
238+
#
239+
# 5.minutes.parts # => {:minutes=>5}
240+
# 3.years.parts # => {:years=>3}
238241
def parts
239242
@parts.dup
240243
end

0 commit comments

Comments
 (0)