diff options
author | soartec-lab <info@soartec-lab.work> | 2019-03-07 22:17:00 +0900 |
---|---|---|
committer | soartec-lab <info@soartec-lab.work> | 2019-03-07 22:33:36 +0900 |
commit | cdf72adffc59a8b56929d7dc5709cad421ba6400 (patch) | |
tree | 9d9c2dc0215a0f0731e54c698182cecfdd9a6e05 /guides/source/active_support_core_extensions.md | |
parent | 6746eea789f3285c66ee618c2786ff3c1ea64b45 (diff) | |
download | rails-cdf72adffc59a8b56929d7dc5709cad421ba6400.tar.gz rails-cdf72adffc59a8b56929d7dc5709cad421ba6400.tar.bz2 rails-cdf72adffc59a8b56929d7dc5709cad421ba6400.zip |
Corrected execution result of Enumerable#sum [ci skip]
Diffstat (limited to 'guides/source/active_support_core_extensions.md')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index b3078ed701..c9faa3195e 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2001,7 +2001,7 @@ Addition only assumes the elements respond to `+`: ```ruby [[1, 2], [2, 3], [3, 4]].sum # => [1, 2, 2, 3, 3, 4] %w(foo bar baz).sum # => "foobarbaz" -{a: 1, b: 2, c: 3}.sum # => [:b, 2, :c, 3, :a, 1] +{a: 1, b: 2, c: 3}.sum # => [:a, 1, :b, 2, :c, 3] ``` The sum of an empty collection is zero by default, but this is customizable: |