These are chat archives for dry-rb/chat

28th
Nov 2015
Piotr Solnica
@solnic
Nov 28 2015 00:00
@AMHOL no idea what "to grip" means :D
Andy Holland
@AMHOL
Nov 28 2015 00:01
:laughing: idioms
Piotr Solnica
@solnic
Nov 28 2015 00:01
dammit mate
;)
Andy Holland
@AMHOL
Nov 28 2015 00:01
To get to grips = to get a better understanding :)
So if I get to grips with {something}, I have a better understanding of {something} than I did before
Piotr Solnica
@solnic
Nov 28 2015 00:02
Oh ok :) it is really simple piece of code tbh. Ast with visitor pattern is really simple. Probably not popular but that is ok
Aaahhh good
Andy Holland
@AMHOL
Nov 28 2015 00:03
Yeah, perhaps to you ;)
Ast is complicated stuff
Piotr Solnica
@solnic
Nov 28 2015 00:03
I thought so too when I saw it for the first time
Andy Holland
@AMHOL
Nov 28 2015 00:05
I think it's just unfamiliar territory, from what I've seen you don't tend to touch AST until you start looking at compilers and sth?
Piotr Solnica
@solnic
Nov 28 2015 00:05
Yeah only compilers deal with then
Them even
Krzysztof Wawer
@wafcio
Nov 28 2015 09:52
How in dry-validation can I construct rule for attribute which is optional but if exists then it should be in specific format ? I am trying to do it in this way: id.nil? | (id.str? & id.format?(/.../)) but I receive NoMethodError: undefined method `to_ary' for true:TrueClass
Piotr Solnica
@solnic
Nov 28 2015 09:57
@wafcio id.filled? & id.format?(/.../) should suffice
Although your example should work too
So pls report an issue
Krzysztof Wawer
@wafcio
Nov 28 2015 10:07
I used str? because I checked examples: a) without id b) with number id - incorrect c) with id as uuid (text) - correct
Krzysztof Wawer
@wafcio
Nov 28 2015 10:16
issue added dryrb/dry-validation#13
Piotr Solnica
@solnic
Nov 28 2015 11:30
@wafcio thanks. I'll fix that
Krzysztof Wawer
@wafcio
Nov 28 2015 12:18
ok thanks, I will bypass this problem with write own predicate
Krzysztof Wawer
@wafcio
Nov 28 2015 12:29
I think it will be good to add optional attribute, right now each time key method is forcing to have specific key in attributes
Piotr Solnica
@solnic
Nov 28 2015 13:11
@wafcio optional attribute or optional value? Those two are not the same
For optional attribute/key we could have sth like key(:foo).optional do ... end
Please report an issue about that
Krzysztof Wawer
@wafcio
Nov 28 2015 14:15
I mean optional key, ok I will report some use case