提交 b947b6ec 编写于 作者: P Peter Jaros

Document that method objects are not `duplicable?`

上级 703a2e8d
......@@ -162,7 +162,7 @@ Active Support provides `duplicable?` to programmatically query an object about
false.duplicable? # => false
```
By definition all objects are `duplicable?` except `nil`, `false`, `true`, symbols, numbers, class, and module objects.
By definition all objects are `duplicable?` except `nil`, `false`, `true`, symbols, numbers, and class, module, and method objects.
WARNING: Any class can disallow duplication by removing `dup` and `clone` or raising exceptions from them. Thus only `rescue` can tell whether a given arbitrary object is duplicable. `duplicable?` depends on the hard-coded list above, but it is much faster than `rescue`. Use it only if you know the hard-coded list is enough in your use case.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册