sord icon indicating copy to clipboard operation
sord copied to clipboard

Optional and required blocks

Open AaronC81 opened this issue 3 years ago • 1 comments

Currently, the behaviour of blocks is a bit strange:

  • When outputting RBI, blocks are always required.
  • When outputting RBS, blocks are always optional.

This inconsistency isn't intuitive and could lead to some confusion, especially when targeting multiple output types. I think required should be the default across both output types, and that you should be able to change it to optional if you want.

I don't believe YARD has a way of specifying if a block is optional or required, so we'd have to hijack an existing tag somehow, like using the word "Optional" at the beginning of @yield to indicate that it's optional for that method.

AaronC81 avatar Jan 13 '21 19:01 AaronC81

I think you're correct about YARD not being able to specify optional blocks. That does make this a bit annoying to resolve.

wagenet avatar Dec 20 '21 21:12 wagenet