Class: Yard::Lint::Validators::Documentation::UndocumentedOptions::Result

Inherits:
Results::Base
  • Object
show all
Defined in:
lib/yard/lint/validators/documentation/undocumented_options/result.rb

Overview

Result object for undocumented options validation

Instance Attribute Summary

Attributes inherited from Results::Base

#config, #offenses

Instance Method Summary collapse

Methods inherited from Results::Base

#count, #each, #empty?, #initialize, #map, #validator_name

Constructor Details

This class inherits a constructor from Yard::Lint::Results::Base

Instance Method Details

#build_message(offense) ⇒ String

Build human-readable message for undocumented options offense

Parameters:

  • offense (Hash)

    offense data with :object_name and :params

Returns:

  • (String)

    formatted message



17
18
19
20
21
22
23
# File 'lib/yard/lint/validators/documentation/undocumented_options/result.rb', line 17

def build_message(offense)
  object_name = offense[:object_name]
  params = offense[:params]

  "Method '#{object_name}' has options parameter (#{params}) " \
    'but no @option tags in documentation.'
end