Class

Duration

Extends:

Provides accurate date and time measurements using Date#advance and Time#advance, respectively. It mainly supports the methods on Numeric, such as in this example:

1.month.ago       # equivalent to Time.now.advance(:months => -1)
Public Attributes
parts
value
Public Methods
+ Adds another Duration or a Numeric to this Duration. Numeric values are treated as seconds.
- Subtracts another Duration or a Numeric from this Duration. Numeric values are treated as seconds.
-@
== Returns true if other is also a Duration instance with the same value, or if other == value.
===
ago Calculates a new Time or Date that is as far in the past as this Duration represents.
from_now Alias for #since
inspect
is_a?
new
since Calculates a new Time or Date that is as far in the future as this Duration represents.
until Alias for #ago
Protected Methods
sum
Private Methods
method_missing
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.