Sha256: 394622ce21a984fb1189e3664291c9d05b06ff3293f24404f821732ab052692b

Contents?: true

Size: 475 Bytes

Versions: 87

Compression:

Stored size: 475 Bytes

Contents

module Acfs::Model::Attributes

  # @api public
  #
  # Integer attribute type. Use it in your model as an attribute type:
  #
  # @example
  #   class User
  #     include Acfs::Model
  #     attribute :name, :integer
  #   end
  #
  class Integer < Base

    # @api public
    #
    # Cast given object to integer.
    #
    # @param [Object] obj Object to cast.
    # @return [Fixnum] Casted object as fixnum.
    #
    def cast_type(obj)
      obj.to_i
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
acfs-0.42.0 lib/acfs/model/attributes/integer.rb
acfs-0.41.1 lib/acfs/model/attributes/integer.rb
acfs-0.41.1.beta1 lib/acfs/model/attributes/integer.rb
acfs-0.41.0 lib/acfs/model/attributes/integer.rb
acfs-0.40.1.rc1 lib/acfs/model/attributes/integer.rb
acfs-0.40.0 lib/acfs/model/attributes/integer.rb
acfs-0.39.1 lib/acfs/model/attributes/integer.rb
acfs-0.39.0 lib/acfs/model/attributes/integer.rb
acfs-0.38.0 lib/acfs/model/attributes/integer.rb
acfs-0.37.0.1.b295 lib/acfs/model/attributes/integer.rb
acfs-0.37.0 lib/acfs/model/attributes/integer.rb
acfs-0.36.0.1.b293 lib/acfs/model/attributes/integer.rb
acfs-0.36.0 lib/acfs/model/attributes/integer.rb
acfs-0.35.0.1.b291 lib/acfs/model/attributes/integer.rb
acfs-0.35.0 lib/acfs/model/attributes/integer.rb
acfs-0.34.1.1.b289 lib/acfs/model/attributes/integer.rb
acfs-0.34.1 lib/acfs/model/attributes/integer.rb
acfs-0.34.0.1.b288 lib/acfs/model/attributes/integer.rb
acfs-0.34.0.1.b287 lib/acfs/model/attributes/integer.rb
acfs-0.34.0.1.b286 lib/acfs/model/attributes/integer.rb