lib/virtus/attribute/time.rb in virtus-0.0.4 vs lib/virtus/attribute/time.rb in virtus-0.0.5
- old
+ new
@@ -14,18 +14,25 @@
# # typecasting from a string
# Post.new(:published_at => '2011/06/09 11:08')
#
# # typecasting from a hash
# Post.new(:published_at => {
- # :year => 2011, :month => 6, :day => 9, :hour => 11, :minutes => 8 })
+ # :year => 2011,
+ # :month => 6,
+ # :day => 9,
+ # :hour => 11,
+ # :minutes => 8
+ # })
#
# # typecasting from an object which implements #to_time
# Post.new(:published_at => DateTime.now)
#
class Time < Object
primitive ::Time
# @see Virtus::Typecast::Time.to_time
+ #
+ # @return [Time]
#
# @api private
def typecast_to_primitive(value)
Typecast::Time.to_time(value)
end