0
votes

How do I tell yard to document class attributes that are set up with Rails' class_attribute method? Currently it's just ignoring them.

An example:

class Base
  class_attribute :defaults

  self.defaults = { foo: 'bar' }
end
1
can't a normal attr tag do ? # @attr [Hash] defaults The default values of something - Mohammad AbuShady
No, that doesn't seem to trigger any documentation. I'm thinking I need to write an extension to YARD - elstgav

1 Answers

0
votes

I've found that using a group tag is a good solution

# @!group Class Attributes
# @!attribute [rw]
# Stores some value
class_attribute :my_atttribute
# @!endgroup