therapy

Version, currently 0.1.01 version
  • 0.1.0latestJan 31, 2026

github.com/matthewmcgarvey/therapy

No description declared in shard.yml.

6 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  therapy:
    github: matthewmcgarvey/therapy
    version: ~> 0.1.0

Then run:

shards install

shard.yml

Crystal
1.6.2
License
MIT
Author
matthewmcgarvey

Dependencies

This version declares no dependencies.

README

Therapy

Get it? Therapy... validation... come on!

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      therapy:
        github: matthewmcgarvey/therapy
  2. Run shards install

Usage

require "therapy"

sign_up_form = Therapy.object(
  email: Therapy.string,
  password: Therapy.string,
  confirm: Therapy.string
).validate("Confirm must match password", path: ["password"]) do |form|
  form[:password] == form[:confirm]
end

json = JSON.parse(request.body)
sign_up = sign_up_form.parse!(json) #=> NamedTuple(email: String, password: String, confirm: String)

See DOCS.md for full type reference, coercions, and validations.

Development

TODO: Write development instructions here

TODO

  • more validations/transformations

Contributing

  1. Fork it (https://github.com/matthewmcgarvey/therapy/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors