# Documenting protected methods

**URL:** <https://forum.crystal-lang.org/t/documenting-protected-methods/6765>\
**Category:** Help & Support\
**Created:** [April 15, 2024, 11:54pm UTC](https://forum.crystal-lang.org/t/documenting-protected-methods/6765 "2024-04-15T23:54:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgaskins](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jgaskins/32/2449_2.png) [@jgaskins](https://forum.crystal-lang.org/u/jgaskins)\
**Post date:** [April 15, 2024, 11:54pm UTC](https://forum.crystal-lang.org/t/documenting-protected-methods/6765/1 "2024-04-15T23:54:26Z")

</div>

Is there a way to document `protected` methods with `crystal docs`? I am trying to document my [`Interro::QueryBuilder`](https://github.com/jgaskins/interro/blob/master/src/query_builder.cr) that generates and executes SQL queries. All of the methods named after SQL clauses like `where` and `order_by` are protected with the intention that knowledge of column names is isolated to the query objects and model objects (the models don’t query the DB themselves).

I want to document these protected methods so someone writing a query object knows what’s available to them, even if those methods are not usable from outside those objects. Is there a way to do that currently? Like an inverse of `:nodoc:`. I see [some `must_include?` methods in the code for the doc generator](https://github.com/crystal-lang/crystal/blob/a4ca7cc396e7c57da5417d9cb38b6b17aa0d9ce6/src/compiler/crystal/tools/doc/generator.cr#L132-L207) right next to the `nodoc?` methods, are they related?

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/blacksmoke16/32/1241_2.png) [@Blacksmoke16](https://forum.crystal-lang.org/u/Blacksmoke16)\
**Post date:** [April 16, 2024, 12:20am UTC](https://forum.crystal-lang.org/t/documenting-protected-methods/6765/2 "2024-04-16T00:20:08Z")

</div>

I would also like this feature. Some related discussion in [Allow protected methods on API docs by Blacksmoke16 · Pull Request #7799 · crystal-lang/crystal · GitHub](https://github.com/crystal-lang/crystal/pull/7799) tho it appears I never did create that issue…
