Project

bm-typed

0.0
No release in over 3 years
A dry-types/dry-struct alternative making the difference between undefined and nil
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 0.8
~> 0
~> 3
= 0.59.2

Runtime

 Project Readme

Typed

Build Status Coverage Status Gem Downloads

Description

Typed is a dry-types + dry-struct alternative. It provides a similar API in order to ease migration. Compared to dry-struct, Typed has an improved support of "nullable" and "missable" fields:

  • Typed::String.nullable : accepts a String, or Nil.
  • Typed::String.missable : accepts a String, or no value at all (represented by Typed::Undefined).
  • Typed::String.nullable.missable : accepts a String, Nil, or no value at all (represented by Typed::Undefined). This behavior is difficult to obtain with dry-struct.

Typed only targets the use-case of converting controller parameters into Ruby objects with proper type checks and coercions.

Install

gem 'bm-typed', require: 'typed'

Documentation

Not yet.

Maturity

This gem is a PoC and it shouldn't be considered production-ready.

License

Copyright (c) 2018 Bannerman, Frederic Terrazzoni

Licensed under the MIT license.