Sha256: a87135942aeddedd30807a06e7f1a6b7d99c4d2052429768cf3c1369c8b7fa1e

Contents?: true

Size: 568 Bytes

Versions: 20

Compression:

Stored size: 568 Bytes

Contents

module Virtus
  class Attribute

    # Integer
    #
    # @example
    #   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
      coercion_method :to_integer

    end # class Integer
  end # class Attribute
end # module Virtus

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
motion_virtus-1.0.0.beta0.1 lib/project/attribute/integer.rb
motion_virtus-1.0.0.beta0 lib/project/attribute/integer.rb
virtus-0.5.5 lib/virtus/attribute/integer.rb
virtus-0.5.4 lib/virtus/attribute/integer.rb
virtus-0.5.3 lib/virtus/attribute/integer.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/lib/virtus/attribute/integer.rb
virtus-0.5.2 lib/virtus/attribute/integer.rb
virtus-0.5.1 lib/virtus/attribute/integer.rb
virtus-0.5.0 lib/virtus/attribute/integer.rb
virtus-0.4.2 lib/virtus/attribute/integer.rb
virtus-0.4.1 lib/virtus/attribute/integer.rb
virtus-0.4.0 lib/virtus/attribute/integer.rb
virtus-0.3.0 lib/virtus/attribute/integer.rb
virtus-0.2.0 lib/virtus/attribute/integer.rb
virtus-0.1.0 lib/virtus/attribute/integer.rb
virtus-0.0.10 lib/virtus/attribute/integer.rb
virtus-0.0.9 lib/virtus/attribute/integer.rb
virtus-0.0.8 lib/virtus/attribute/integer.rb
virtus-0.0.7 lib/virtus/attribute/integer.rb
virtus-0.0.6 lib/virtus/attribute/integer.rb