Sha256: 1419b5aabadc7897057e6e7e10a887f4f9b5ff1d27a7101b5329b302dce71eb4
Contents?: true
Size: 681 Bytes
Versions: 1
Compression:
Stored size: 681 Bytes
Contents
module Virtus class Attribute # Example usage: # # class Post # include Virtus # # attribute :read_count, Integer # end # # Post.new(:read_count => 100) # # # typecasting from a string # Post.new(:read_count => '100') # # # typecasting from an object that implements #to_i # Post.new(:read_count => 100.0) # class Integer < Numeric primitive ::Integer # @see Virtus::Typecast::Numeric.to_i # # @api private def typecast_to_primitive(value) Typecast::Numeric.to_i(value) end end # class Integer end # class Attribute end # module Virtus
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
virtus-0.0.4 | lib/virtus/attribute/integer.rb |