Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Docs for +duplicable?+

  • Loading branch information...
commit 49e7555a5ed5463fdf13474259e285d41f171da8 1 parent bb626e7
@smartinez87 smartinez87 authored
Showing with 28 additions and 4 deletions.
  1. +28 −4 activesupport/lib/active_support/core_ext/object/duplicable.rb
View
32 activesupport/lib/active_support/core_ext/object/duplicable.rb
@@ -22,25 +22,49 @@ def duplicable?
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
Please sign in to comment.
Something went wrong with that request. Please try again.