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