Sha256: e5a507c3ce6268f85dbf28f6d80f76401cc3e8f03ab75586bf51b4ef3a419ca1

Contents?: true

Size: 330 Bytes

Versions: 8

Compression:

Stored size: 330 Bytes

Contents

module Alf
  module Types
    #
    # Defines a Size domain, as a (non strictly) positive integer.
    #
    class Size < Integer
      extend Domain::SByC.new(Integer){|i| i >= 0}

      coercions do |c|
        c.upon(Object){|s,t| new Support.coerce(s, Integer) }
      end

    end # Size
 end # module Types
end # module Alf

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
alf-core-0.16.3 lib/alf/types/size.rb
alf-core-0.16.2 lib/alf/types/size.rb
alf-core-0.16.1 lib/alf/types/size.rb
alf-core-0.16.0 lib/alf/types/size.rb
alf-core-0.15.0 lib/alf/types/size.rb
alf-core-0.14.0 lib/alf-types/alf/types/size.rb
alf-core-0.13.1 lib/alf-types/alf/types/size.rb
alf-core-0.13.0 lib/alf-types/alf/types/size.rb