Sha256: 0c6fed1109fa73769134aca7953882823592b6071f8b2ebfed9387084e582054
Contents?: true
Size: 531 Bytes
Versions: 17
Compression:
Stored size: 531 Bytes
Contents
module Acfs::Resource::Attributes # @api public # # Integer attribute type. Use it in your model as an attribute type: # # @example # class User < Acfs::Resource # attribute :name, :integer # end # class Integer < Base # @api public # # Cast given object to integer. # # @param [Object] value Object to cast. # @return [Fixnum] Casted object as fixnum. # def cast_value(value) if value.blank? 0 else Integer(value) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems