These are chat archives for dry-rb/chat

30th
Aug 2018
Cedric Brancourt
@Electron-libre
Aug 30 2018 07:44
Hi, I'am looking for examples of building dry-validation dynamic schema.
As solnic wrote that it was possilbe to build dry predicates and pass them to the schema builder , but I can't find any examples.
Thanks for your help
Cedric Brancourt
@Electron-libre
Aug 30 2018 07:51
I tried somthing like this :
r = Dry::Logic::Rule::Predicate.new(Dry::Logic::Predicates[:key?]).curry(:foo)
 sc = Dry::Validation.Schema(rules: [r])
sc.call({}).errors
....
*** FrozenError Exception: can't modify frozen Array
Jonah
@jonahx
Aug 30 2018 16:10
anyone know of a dry (or other) lib that provides lens capability for hashes? i was looking at Transproc Hash functions but I don’t see anything that would allow lens capability (ie, the “update” version of dig)