24 lines
797 B
Ruby
Raw Normal View History

# typed: strict
# frozen_string_literal: true
2024-01-26 11:36:08 -08:00
# This follows the docs at https://github.com/lsegal/yard/blob/main/docs/Templates.md#setuprb
# rubocop:disable Style/TopLevelMethodDefinition
sig { void }
def init
2023-04-05 10:06:45 -07:00
# `sorbet` is available transitively through the `yard-sorbet` plugin, but we're
# outside of the standalone sorbet config, so `checked` is enabled by default
T.bind(self, T.all(T::Class[T.anything], YARD::Templates::Template), checked: false)
super
return if sections.empty?
sections[:index].place(:internal).before(:private)
end
sig { returns(T.nilable(String)) }
def internal
2023-04-05 10:06:45 -07:00
T.bind(self, YARD::Templates::Template, checked: false)
erb(:internal) if object.has_tag?(:api) && object.tag(:api).text == "internal"
end
2024-01-26 11:36:08 -08:00
# rubocop:enable Style/TopLevelMethodDefinition