2.09
No commit activity in last 3 years
No release in over 3 years
Define types with optional constraints for use within axiom and other libraries.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.5.3, ~> 1.5

Runtime

~> 0.11.0
>= 0.3.1, ~> 0.3
 Project Readme

axiom-types

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

Gem Version Build Status Dependency Status Code Climate Coverage Status

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

Contributing

See CONTRIBUTING.md for details.

Copyright

Copyright © 2013 Dan Kubb. See LICENSE for details.