Class: Docscribe::Plugin::Tag

Inherits:
Struct
  • Object
show all
Defined in:
lib/docscribe/plugin/tag.rb

Overview

A single YARD-style tag returned by a TagPlugin.

Examples:

Simple tag

Tag.new(name: 'since', text: '1.3.0')
# => # @since 1.3.0

Tag with types

Tag.new(name: 'raise', types: ['ArgumentError'], text: 'if name is nil')
# => # @raise [ArgumentError] if name is nil

Instance Attribute Summary collapse

Instance Attribute Details

#nameString

Returns tag name without leading @.

Returns:

  • (String)

    tag name without leading @



21
# File 'lib/docscribe/plugin/tag.rb', line 21

Tag = Struct.new(:name, :text, :types, keyword_init: true)

#textString?

Returns text after the type bracket.

Returns:

  • (String, nil)

    text after the type bracket



21
# File 'lib/docscribe/plugin/tag.rb', line 21

Tag = Struct.new(:name, :text, :types, keyword_init: true)

#typesArray<String>?

Returns optional type list rendered as [Foo, Bar].

Returns:

  • (Array<String>, nil)

    optional type list rendered as [Foo, Bar]



21
# File 'lib/docscribe/plugin/tag.rb', line 21

Tag = Struct.new(:name, :text, :types, keyword_init: true)