aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJulio Lopez <ljuliom@gmail.com>2015-07-10 18:03:40 -0500
committerJulio Lopez <ljuliom@gmail.com>2015-07-10 18:03:40 -0500
commitd1630c38b30de37e8936e103a137e9c5d3381f21 (patch)
tree1a426ac77e3972bac8b8f67cc5c931d5720f55dd /activesupport
parenteb10496a1c3d9fe58b91aa0ec17d9f218738d5dc (diff)
downloadrails-d1630c38b30de37e8936e103a137e9c5d3381f21.tar.gz
rails-d1630c38b30de37e8936e103a137e9c5d3381f21.tar.bz2
rails-d1630c38b30de37e8936e103a137e9c5d3381f21.zip
improve duplicable documentation [ci skip]
Diffstat (limited to 'activesupport')
-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