Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Correct method notation for #acts_like? [ci skip]

  • Loading branch information...
commit cab6ba4e1bf2abf6a5fb83f2f28e2a8482350bbd 1 parent 94a636f
Doug Yun duggiefresh authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 activesupport/lib/active_support/core_ext/object/acts_like.rb
8 activesupport/lib/active_support/core_ext/object/acts_like.rb
View
@@ -1,9 +1,9 @@
class Object
# 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.
+ # to define an <tt>acts_like_date?</tt> method, and extends Time to define
+ # <tt>acts_like_time?</tt>. As a result, we can do <tt>x.acts_like?(:time)</tt> and
+ # <tt>x.acts_like?(:date)</tt> to do duck-type-safe comparisons, since classes that
+ # we want to act like Time simply need to define an <tt>acts_like_time?</tt> method.
def acts_like?(duck)
respond_to? :"acts_like_#{duck}?"
end
Please sign in to comment.
Something went wrong with that request. Please try again.