prop

Properties utilities for Crystal lang (improved getter, IoC, factory, ...). getter ioc factory config di dependency-injection
0.7.1 Latest release released

Prop

CI Status GitHub release Docs

Properties utilities for Crystal lang.

Mixin module that should be included in a class or a struct. This module improves the std's accessor macros (getter, getter!, getter?, property, ...). It provide a kind of IoC (Inversion Of Control).

Installation

  1. Add the dependency to your shard.yml:
   dependencies:
     prop:
       github: nicolab/crystal-prop
  1. Run shards install

Usage

📘 API doc.

If you are looking for a validator to validate data before instantiating a class or a struct, you may be interested by validator. This validator shard uses Prop internally to define and handle validation rules on each instance variable.

Development

Install dev dependencies:

shards install

Run:

crystal spec

Clean before commit:

crystal tool format
./bin/ameba

Contributing

  1. Fork it (https://github.com/Nicolab/crystal-prop/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

LICENSE

MIT (c) 2021, Nicolas Talle.

Author

| Nicolas Tallefourtane - Nicolab.net | |---| | Nicolas Talle | | Make a donation via Paypal |

prop:
  github: nicolab/crystal-prop
  version: ~> 0.7.1
License MIT
Crystal >= 0.36.1

Authors

Dependencies 0

Development Dependencies 2

  • ameba ~> 0.14.2
    {'github' => 'crystal-ameba/ameba', 'version' => '~> 0.14.2'}
  • testify ~> 1.0.1
    {'github' => 'Nicolab/crystal-testify', 'version' => '~> 1.0.1'}

Dependents 1

Last synced .
search fire star recently