From 49e7555a5ed5463fdf13474259e285d41f171da8 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Sun, 17 Apr 2011 20:38:50 -0300 Subject: Docs for +duplicable?+ --- .../active_support/core_ext/object/duplicable.rb | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'activesupport') 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 -- cgit v1.2.3