Sha256: 2c684f5f45a284bbef591287641e00d6fdfe9fa4b065892b81e4bdcfaea7b64f
Contents?: true
Size: 820 Bytes
Versions: 18
Compression:
Stored size: 820 Bytes
Contents
module Virtus class Attribute # DateTime # # @example # class Post # include Virtus # # attribute :published_at, DateTime # end # # Post.new(:published_at => DateTime.now) # # # typecasting from a string # Post.new(:published_on => '2011/06/09 10:48') # # # typecasting from a hash # Post.new(:published_on => { # :year => 2011, # :month => 6, # :day => 9, # :hour => 10, # :min => 48, # }) # # # typecasting from an object which implements #to_datetime # Post.new(:published_on => Time.now) # class DateTime < Object primitive ::DateTime coercion_method :to_datetime end # class DateTim end # class Attribute end # module Virtus
Version data entries
18 entries across 18 versions & 2 rubygems