class YARD::Verifier

Similar to a Proc, but runs a set of Ruby expressions using a small DSL to make tag lookups easier.

The syntax is as follows:

@example Create a verifier to check for objects that don’t have @private tags

verifier = Verifier.new('!@private')
verifier.call(object) # => true (no @private tag)

@example Create a verifier to find any return tag with an empty description

Verifier.new('@return.text.empty?')
# Equivalent to:
Verifier.new('object.tag(:return).text.empty?')

@example Check if there are any @param tags

Verifier.new('@@param.empty?')
# Equivalent to:
Verifier.new('object.tags(:param).empty?')

@example Using object or o to look up object attributes directly

Verifier.new('object.docstring == "hello world"')
# Equivalent to:
Verifier.new('o.docstring == "hello world"')

@example Without using object or o

Verifier.new('tag(:return).size == 1 || has_tag?(:author)')

@example Specifying multiple expressions

Verifier.new('@return', '@param', '@yield')
# Equivalent to:
Verifier.new('@return && @param && @yield')