These are chat archives for dry-rb/chat

21st
Nov 2015
Krzysztof Wawer
@wafcio
Nov 21 2015 15:09
I am reading dry-data gem and I am wondering what does float = Dry::Data["float”] do. In documentation you wrote that it pass through input, so it basically do nothing ?
Piotr Solnica
@solnic
Nov 21 2015 16:01
@wafcio yes, it’s a base type from which other types can be derived, I should document this better (I was already asked about this so I guess it makes people confused).
dry-data is more sophisticated than virtus, it’s meant to work as a type system with various ways of defining a type, this may or may not include coercions, it also may or may not include various constraints, like strict which will check exact type, or maybe which will return an optional type (using kleisli) etc.
Piotr Solnica
@solnic
Nov 21 2015 16:06
I will also make a clear distinction between core ruby coercions (already supported) and the crazy web-form coercions, those will be separated from the core ones
so ie I’ll be adding soon types like strict.coercible.form.date etc
I need to experiment with that a bit, I’m not sure if we want form coercions to return plain values or wrap them in some response object so that we can know precisely what went wrong
in any way, this will be more granular, more powerul, more extendible, and faster than virtus (and probably faster than anything else, given that it’s gonna focus on specific coercion logic)
Krzysztof Wawer
@wafcio
Nov 21 2015 16:11
thank you, before start experimenting with rodakase I want understand dry gems
Piotr Solnica
@solnic
Nov 21 2015 16:13
@wafcio that's a good first step, rodakase sooner or later will become a shell for other gems, it won't do much haha
I'm wrapping up huge dry-validation rewrite in the upcoming days, then I'll work on dry-data more, get it out of alpha state for sure and add types for web stuff. We also need to improve some things in dry-container. Release dry-constructor, update dry-auto_inject to use it etc. Cool things are happening :)
Andy Holland
@AMHOL
Nov 21 2015 18:27
@solnic registering like this in the current released version will create a new predicate each time it is resolved
Should probably be register(name, Predicate.new(name, &block))