Sha256: 45733ad14766296e3cbd6720688a923ea60c164ead492fd3edb7607837835b5e
Contents?: true
Size: 562 Bytes
Versions: 7
Compression:
Stored size: 562 Bytes
Contents
# frozen_string_literal: true 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
7 entries across 7 versions & 1 rubygems