diff options
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index 0ae641d05b..084d13a9e3 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -35,10 +35,14 @@ module ActiveSupport end def is_a?(klass) #:nodoc: - Duration == klass || value.is_a?(klass) + instance_of?(klass) || value.is_a?(klass) end alias :kind_of? :is_a? + def instance_of?(klass) # :nodoc: + Duration == klass + end + # Returns +true+ if +other+ is also a Duration instance with the # same +value+, or if <tt>other == value</tt>. def ==(other) |