aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/duration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/duration.rb')
-rw-r--r--activesupport/lib/active_support/duration.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb
index 1a6c02a39b..a54494bc65 100644
--- a/activesupport/lib/active_support/duration.rb
+++ b/activesupport/lib/active_support/duration.rb
@@ -7,7 +7,7 @@ module ActiveSupport
# Time#advance, respectively. It mainly supports the methods on Numeric.
#
# 1.month.ago # equivalent to Time.now.advance(months: -1)
- class Duration < ProxyObject
+ class Duration
attr_accessor :value, :parts
def initialize(value, parts) #:nodoc:
@@ -53,6 +53,10 @@ module ActiveSupport
end
end
+ def to_s
+ @value.to_s
+ end
+
def eql?(other)
other.is_a?(Duration) && self == other
end
@@ -89,6 +93,10 @@ module ActiveSupport
to_i
end
+ def respond_to_missing?(method, include_private=false) #:nodoc
+ @value.respond_to?(method, include_private)
+ end
+
protected
def sum(sign, time = ::Time.current) #:nodoc: