virtual_date

To and from dates in a second

Details

Install

sudo gem install virtual_date

Example usage

class MyClass
  include VirtualDate

  attr_accessor :some_date
  act_as_virtual_date :some_date
end

obj = MyClass.bew
obj.some_date = Date.today

obj.some_date_str # => 2011-04-18
obj.some_date_str("%d/%m/%Y") # => 18/04/2011

Copyright © 2011 Túlio Ornelas. See LICENSE for details.