From fdc5e768ca29e3ad4288dcd8a8c7147cea8a1f97 Mon Sep 17 00:00:00 2001 From: Peter Jaros Date: Wed, 3 Sep 2014 16:00:06 -0400 Subject: Methods are not duplicable. --- activesupport/lib/active_support/core_ext/object/duplicable.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport/lib/active_support/core_ext/object/duplicable.rb') diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb index c5d59128e5..665cb0f96d 100644 --- a/activesupport/lib/active_support/core_ext/object/duplicable.rb +++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb @@ -91,3 +91,13 @@ class BigDecimal # can't dup, so use superclass implementation end end + +class Method + # Methods are not duplicable: + # + # method(:puts).duplicable? # => false + # method(:puts).dup # => TypeError: allocator undefined for Method + def duplicable? + false + end +end -- cgit v1.2.3