public
Description: conversions, validations and helpers to deal with elapsed time as english and stored as seconds
Homepage:
Clone URL: git://github.com/sbfaulkner/elapsed_time.git
name age message
file MIT-LICENSE Thu Jun 12 11:35:47 -0700 2008 initial commit [sbfaulkner]
file README.markdown Mon Aug 18 19:03:45 -0700 2008 change readme to markdown [sbfaulkner]
file Rakefile Thu Jun 12 11:35:47 -0700 2008 initial commit [sbfaulkner]
file init.rb Thu Jun 12 11:35:47 -0700 2008 initial commit [sbfaulkner]
directory lib/ Thu Jun 12 11:35:47 -0700 2008 initial commit [sbfaulkner]
directory test/ Thu Jun 12 11:35:47 -0700 2008 initial commit [sbfaulkner]
README.markdown

ElapsedTime

Add support for converting an English representation of elapsed time into seconds and back (with validation).

Example

"1 day, 10 hours, 17 minutes and 36 seconds".parse_elapsed_time
=> 123456

123456.to_elapsed_time
=> "1 day, 10 hours, 17 minutes and 36 seconds"

class Job < ActiveRecord::Base
  elapsed_time :estimate
  validates_elapsed_time_of :estimate, :allow_nil => true
end

Legal

Author: S. Brent Faulkner brentf@unwwwired.net
License: Copyright © 2008 unwwwired.net, released under the MIT license