From 609c1988d2e274b365c5299cc5933fb6855e4175 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 28 Mar 2009 23:43:03 -0700 Subject: Tease out Object#acts_like? behaviors --- activesupport/lib/active_support/core_ext/object/misc.rb | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'activesupport/lib/active_support/core_ext/object/misc.rb') diff --git a/activesupport/lib/active_support/core_ext/object/misc.rb b/activesupport/lib/active_support/core_ext/object/misc.rb index 4acdfa3d6c..fb1bcdb98f 100644 --- a/activesupport/lib/active_support/core_ext/object/misc.rb +++ b/activesupport/lib/active_support/core_ext/object/misc.rb @@ -77,14 +77,4 @@ class Object def with_options(options) yield ActiveSupport::OptionMerger.new(self, options) end - - # A duck-type assistant method. For example, Active Support extends Date - # to define an acts_like_date? method, and extends Time to define - # acts_like_time?. As a result, we can do "x.acts_like?(:time)" and - # "x.acts_like?(:date)" to do duck-type-safe comparisons, since classes that - # we want to act like Time simply need to define an acts_like_time? method. - def acts_like?(duck) - respond_to? "acts_like_#{duck}?" - end - end -- cgit v1.2.3