aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-07-11 09:34:08 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2015-07-11 09:34:08 +0200
commita6d74606a7a78c74d46242aa2839c5bb623de0f6 (patch)
tree71a765d974e09aeedb5fff6baa9dc327df57511e /activesupport/lib/active_support
parent6eca1fd8852c10123f4a5be94c827953c1a3fbc5 (diff)
parentd1630c38b30de37e8936e103a137e9c5d3381f21 (diff)
downloadrails-a6d74606a7a78c74d46242aa2839c5bb623de0f6.tar.gz
rails-a6d74606a7a78c74d46242aa2839c5bb623de0f6.tar.bz2
rails-a6d74606a7a78c74d46242aa2839c5bb623de0f6.zip
Merge pull request #20838 from TheBlasfem/improve_duplicable_documentation
Improve duplicable documentation [ci skip]
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/object/duplicable.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb
index 620f7b6561..6fc0cb53f0 100644
--- a/activesupport/lib/active_support/core_ext/object/duplicable.rb
+++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb
@@ -19,7 +19,7 @@
class Object
# Can you safely dup this object?
#
- # False for +nil+, +false+, +true+, symbol, number objects;
+ # False for +nil+, +false+, +true+, symbol, number, method objects;
# true otherwise.
def duplicable?
true
@@ -78,6 +78,10 @@ end
require 'bigdecimal'
class BigDecimal
+ # BigDecimals are duplicable:
+ #
+ # BigDecimal.new("1.2").duplicable? # => true
+ # BigDecimal.new("1.2").dup # => #<BigDecimal:7f9d698eee10,'0.12E1',18(18)>
def duplicable?
true
end