diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-11 09:34:08 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-07-11 09:34:08 +0200 |
commit | a6d74606a7a78c74d46242aa2839c5bb623de0f6 (patch) | |
tree | 71a765d974e09aeedb5fff6baa9dc327df57511e /activesupport | |
parent | 6eca1fd8852c10123f4a5be94c827953c1a3fbc5 (diff) | |
parent | d1630c38b30de37e8936e103a137e9c5d3381f21 (diff) | |
download | rails-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')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/duplicable.rb | 6 |
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 |