These are chat archives for dry-rb/chat

13th
Nov 2017
Piotr Solnica
@solnic
Nov 13 2017 07:37
@cored pls ask questions about usage / support on discourse.dry-rb.org
Bartosz Bonisławski
@bbonislawski
Nov 13 2017 10:08

Hi, does someone have some good patterns for documenting input/output of operations from dry-transaction?
Atm I'm doing something like this:

    # Creates adjustment for order
    #
    # @param [Hash] input input for operation
    # @option input [Order] :order !!document this
    # @option input [Adjustable] :adjustable !!document this
    # @option input [Boolean] :included !!document this
    #
    # @return [Dry::Monads::Either::Right, Dry::Monads::Either::Left, #success?, #failure?, #value]
    #

but i'm not sure if it's clear enough for users. What do you think?

Bartosz Bonisławski
@bbonislawski
Nov 13 2017 10:22
Screen Shot 2017-11-13 at 11.13.30.png
looks like that in yard
Andrew Kozin
@nepalez
Nov 13 2017 11:00
Btw that’s what inspired dry-initializer syntax
Rafael George
@cored
Nov 13 2017 14:30
@solnic will do, thanks
Andriy Tyurnikov
@andriytyurnikov
Nov 13 2017 20:36
dry-structs are not supposed to be used for sophisticated nested scenarios ?
Nikita Shilnikov
@flash-gordon
Nov 13 2017 20:52
@andriytyurnikov wdym by sophisticated? :)
Andriy Tyurnikov
@andriytyurnikov
Nov 13 2017 20:58
@flash-gordon :D arrays of hashes of hashes of arrays of hashes ... or even number :)
Nikita Shilnikov
@flash-gordon
Nov 13 2017 21:03
well, nested structures are supported, including arrays. Can't say I have such examples in my project though, this really depends on your case (performance requirements for instance)
Andriy Tyurnikov
@andriytyurnikov
Nov 13 2017 21:07
@flash-gordon , i don't expect performance issues here - trying to play with it for input/output contracts... just read "Struct classes quack like dry-types"
Nikita Shilnikov
@flash-gordon
Nov 13 2017 21:28
then you should be fine