FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

dkubb/axiom-types: Define types with optional constraints · GitHub

Repository files navigation

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

Contributing

See CONTRIBUTING.md for details.

Copyright

Copyright © 2013 Dan Kubb. See LICENSE for details.

About

Define types with optional constraints

Resources

Contributing

Stars

38 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL