Typed is a
dry-struct alternative. It provides a similar API in order to ease migration.
Typed has an improved support of "nullable" and "missable" fields:
Typed::String.nullable: accepts a
Typed::String.missable: accepts a
String, or no value at all (represented by
Typed::String.nullable.missable: accepts a
Nil, or no value at all (represented by
Typed::Undefined). This behavior is difficult to obtain with
Typed only targets the use-case of converting controller parameters into Ruby objects with proper type checks and coercions.
gem 'bm-typed', require: 'typed'
This gem is a PoC and it shouldn't be considered production-ready.
Licensed under the MIT license.