diff options
author | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-17 20:38:50 -0300 |
---|---|---|
committer | Sebastian Martinez <sebastian@wyeworks.com> | 2011-04-17 20:38:50 -0300 |
commit | 49e7555a5ed5463fdf13474259e285d41f171da8 (patch) | |
tree | b7ab6deacbd4665463e43162924703d3d693e0b0 /activesupport/lib/active_support | |
parent | bb626e785a9ad32d025e429af24654f2af662d09 (diff) | |
download | rails-49e7555a5ed5463fdf13474259e285d41f171da8.tar.gz rails-49e7555a5ed5463fdf13474259e285d41f171da8.tar.bz2 rails-49e7555a5ed5463fdf13474259e285d41f171da8.zip |
Docs for +duplicable?+
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/object/duplicable.rb | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb index b05325790c..0f9129d0b6 100644 --- a/activesupport/lib/active_support/core_ext/object/duplicable.rb +++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb @@ -22,25 +22,49 @@ class Object end end -class NilClass #:nodoc: +class NilClass + # Instances of NilClass are not duplicable + # + # === Example + # + # nil.duplicable? # => false + # nil.dup # => TypeError: can't dup NilClass def duplicable? false end end -class FalseClass #:nodoc: +class FalseClass + # Instances of FalseClass are not duplicable + # + # === Example + # + # false.duplicable? # => false + # false.dup # => TypeError: can't dup FalseClass def duplicable? false end end -class TrueClass #:nodoc: +class TrueClass + # Instances of TrueClass are not duplicable + # + # === Example + # + # true.duplicable? # => false + # true.dup # => TypeError: can't dup TrueClass def duplicable? false end end -class Symbol #:nodoc: +class Symbol + # Symbols are not duplicable + # + # === Example + # + # :my_symbol.duplicable? # => false + # :my_symbol.dup # => TypeError: can't dup Symbol def duplicable? false end |