Sha256: 52b945bf740bf816353a9d8e4e9ad833094af8ad77b5fd357ee9f277ef7c9db8

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

axiom-types
===========

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

[![Gem Version](https://badge.fury.io/rb/axiom-types.png)][gem]
[![Build Status](https://secure.travis-ci.org/dkubb/axiom-types.png?branch=master)][travis]
[![Dependency Status](https://gemnasium.com/dkubb/axiom-types.png)][gemnasium]
[![Code Climate](https://codeclimate.com/github/dkubb/axiom-types.png)][codeclimate]
[![Coverage Status](https://coveralls.io/repos/dkubb/axiom-types/badge.png?branch=master)][coveralls]

[gem]: https://rubygems.org/gems/axiom-types
[travis]: https://travis-ci.org/dkubb/axiom-types
[gemnasium]: https://gemnasium.com/dkubb/axiom-types
[codeclimate]: https://codeclimate.com/github/dkubb/axiom-types
[coveralls]: https://coveralls.io/r/dkubb/axiom-types

Examples
--------

```ruby
# 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
```

Contributing
-------------

See [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Copyright
---------

Copyright © 2013 Dan Kubb. See LICENSE for details.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-types-0.0.4 README.md
axiom-types-0.0.3 README.md