These are chat archives for dry-rb/chat

28th
Sep 2017
MarkT
@paradisaeidae
Sep 28 2017 03:36
thnx @solnic. Had some gem cleaning to do, pathnames, new version of Ruby to bed in, chores, then installed dry-types 0.10.2 as it really, really wanted it... now to reduce the dep warns..!
Aaron Jensen
@aaronjensen
Sep 28 2017 05:42
Is there a recommended intro/here's why you should use ROM conference talk or post?
Ahmad A.Elghany
@ahmgeek
Sep 28 2017 07:21
hello: dry-rb/dry-types#184
can someone point the cause of this?
Gustavo Caso
@GustavoCaso
Sep 28 2017 07:38
@ahmgeek I'm currently investigating it
I hope to have a fix ASAP
Ahmad A.Elghany
@ahmgeek
Sep 28 2017 07:40
thanks
Gustavo Caso
@GustavoCaso
Sep 28 2017 09:05
@ahmgeek are you experiencing this bug? Can you update the issue with the code that is breaking?
Ahmad A.Elghany
@ahmgeek
Sep 28 2017 09:08
@GustavoCaso I am sorry, it 's a different bug I would say, same characteristics but different sauce, it seems related tho, will update the issue soon.
Piotr Solnica
@solnic
Sep 28 2017 09:24
@ahmgeek there's http://gitter.im/rom-rb/chat which is a better place to ask questions about the project
gah, this was supposed to mention @aaronjensen ^
Ahmad A.Elghany
@ahmgeek
Sep 28 2017 09:46
:sweat_smile:
Markus Unterwaditzer
@untitaker
Sep 28 2017 15:17
Hello, I have a struct Bar which I want to behave like defined in the specs. I've gotten it to "work", but particularly .optional.default seems more like a hack. Any input? https://gist.github.com/untitaker/f2b6b20ad7d1a658264c3f6a8334fa5a
Note that I'm aware of the idea to have different constructors for different data sources, but since we're trying to migrate an older codebase to dry-rb we don't want to focus on that right now.
Nikita Shilnikov
@flash-gordon
Sep 28 2017 15:26
it's not a hack. In strict_with_defaults all keys are required (except defaults ofc)
Markus Unterwaditzer
@untitaker
Sep 28 2017 15:27
@flash-gordon So x.optional actually means something like x | nil? I thought this was a hack because I would've thought that the wording "optional" would imply a default.
Nikita Shilnikov
@flash-gordon
Sep 28 2017 15:29
ahh, I see, yes, you're absolutely right, Types::Strict::Int.optional is literally the same as Types::Strict::Nil | Types::Strict::Int
Markus Unterwaditzer
@untitaker
Sep 28 2017 15:30
@flash-gordon hmm that kind of makes sense... is there any built-in shortcut to .optional.default(nil) then?
Nikita Shilnikov
@flash-gordon
Sep 28 2017 15:34
nope