Skip to content

Commit a5af0a9

Browse files
committed
Add example to parts documentation [ci-skip]
1 parent 9c3ffab commit a5af0a9

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)