Closed sds closed 2 months ago
Hi there,
this is a good question. I thought this case should be documented like so:
# @return [String] description of attr_one
attr_reader :attr_one
# @return [String] description of attr_two
attr_reader :attr_two
This seems to be the case since 2010: https://gist.github.com/koraktor/587533
I will try to take another look after work.
I was trying to stay away from using @attr_reader
since according to YARD's documentation all @attr*
-related tags are deprecated in favor of @!attribute
(see http://www.rubydoc.info/gems/yard/file/docs/Tags.md).
I'm fine splitting up the declarations and using the deprecated form for now, but it would be great to have Inch recognize it.
@sds no,no, noooooo :grin: ... that's not what I meant by posting the link.
I was trying to describe that I do it using @return
tags on individual attributes.
# @return [String] description of attr_one
attr_reader :attr_one
# @return [String] description of attr_two
attr_reader :attr_two
Some think this bloats their code (to put each attribute on its own line). I posted the link simply because the gist suggests that the "one attribute per line" thing is around since the days of @attr_reader
, not to advise you to use it.
Sorry for the confusion, I mispoke (long day for me).
I indeed didn't end up using @attr_reader
. Thanks for the clarification that it isn't necessary in this case. :)
Which syntax for documenting attributes does InchCI support? For situations where I declare a number of attributes using a single
attr_reader
call, e.g.Ideally, I should be able to document these as:
However, this doesn't appear to work. Am I misunderstanding how the
@!attribute
YARD directive is meant to be used?Re: [U] SlimLint::Document#source_lines in sds/slim-lint