Gem Version Build Status Dependency Status Code Climate Coverage Status

axiom-types

Define types with optional constraints for use within axiom and other libraries.

Examples

# Setup constraints for all defined types
Axiom::Types.finalize

# Create Name subtype
Name = Axiom::Types::String.new do
  minimum_length 1
  maximum_length 30
end

# Test if the string is a member of the type
Name.include?('a')       # => true
Name.include?('a' * 30)  # => true
Name.include?('')        # => false
Name.include?('a' * 31)  # => false

Installation

With Rubygems:

$ gem install axiom-types
$ irb -rubygems
>> require 'axiom-types'
=> true

With git and local working copy:

$ git clone git://github.com/dkubb/axiom-types.git
$ cd axiom-types
$ rake install
$ irb -rubygems
>> require 'axiom-types'
=> true

Contributing

See CONTRIBUTING.md for details.

Copyright © 2013 Dan Kubb. See LICENSE for details.