diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-28 23:43:03 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-28 23:43:26 -0700 |
commit | 609c1988d2e274b365c5299cc5933fb6855e4175 (patch) | |
tree | 83c132d1cca1f3eb632c06d007c76399f9bec5c3 /activesupport/lib/active_support/core_ext/time | |
parent | 389b081e374e0c6f2c124837439628684cd4f704 (diff) | |
download | rails-609c1988d2e274b365c5299cc5933fb6855e4175.tar.gz rails-609c1988d2e274b365c5299cc5933fb6855e4175.tar.bz2 rails-609c1988d2e274b365c5299cc5933fb6855e4175.zip |
Tease out Object#acts_like? behaviors
Diffstat (limited to 'activesupport/lib/active_support/core_ext/time')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/acts_like.rb | 8 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/behavior.rb | 13 |
2 files changed, 8 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/acts_like.rb b/activesupport/lib/active_support/core_ext/time/acts_like.rb new file mode 100644 index 0000000000..3f853b7893 --- /dev/null +++ b/activesupport/lib/active_support/core_ext/time/acts_like.rb @@ -0,0 +1,8 @@ +require 'active_support/core_ext/object/acts_like' + +class Time + # Duck-types as a Time-like class. See Object#acts_like?. + def acts_like_time? + true + end +end diff --git a/activesupport/lib/active_support/core_ext/time/behavior.rb b/activesupport/lib/active_support/core_ext/time/behavior.rb deleted file mode 100644 index a5c0baacdf..0000000000 --- a/activesupport/lib/active_support/core_ext/time/behavior.rb +++ /dev/null @@ -1,13 +0,0 @@ -module ActiveSupport #:nodoc: - module CoreExtensions #:nodoc: - module Time #:nodoc: - module Behavior - # Enable more predictable duck-typing on Time-like classes. See - # Object#acts_like?. - def acts_like_time? - true - end - end - end - end -end |