From f28eef9a272fd9280416fd8c0984f616ffe102fe Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 15 Jan 2007 17:12:32 +0000 Subject: Add Object#acts_like? and Time#acts_like_time? and Date#acts_like_date? to facilitate duck-typing git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5951 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/date/behavior.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 activesupport/lib/active_support/core_ext/date/behavior.rb (limited to 'activesupport/lib/active_support/core_ext/date') diff --git a/activesupport/lib/active_support/core_ext/date/behavior.rb b/activesupport/lib/active_support/core_ext/date/behavior.rb new file mode 100644 index 0000000000..011cc17cbf --- /dev/null +++ b/activesupport/lib/active_support/core_ext/date/behavior.rb @@ -0,0 +1,13 @@ +module ActiveSupport #:nodoc: + module CoreExtensions #:nodoc: + module Date #:nodoc: + module Behavior + # Enable more predictable duck-typing on Date-like classes. See + # Object#acts_like?. + def acts_like_date? + true + end + end + end + end +end -- cgit v1.2.3