Sha256: 7689ce9105877315a224e09106876e27d7f0ce30611b71a898d5bd56836e1d8d
Contents?: true
Size: 792 Bytes
Versions: 20
Compression:
Stored size: 792 Bytes
Contents
module Virtus class Attribute # Time # # @example # class Post # include Virtus # # attribute :published_at, Time # end # # Post.new(:published_at => Time.now) # # # 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, # :min => 8, # }) # # # typecasting from an object which implements #to_time # Post.new(:published_at => DateTime.now) # class Time < Object primitive ::Time coercion_method :to_time end # class Time end # class Attribute end # module Virtus
Version data entries
20 entries across 20 versions & 3 rubygems