Skip to content

getbannerman/typed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages