Class: Yard::Lint::Validators::Documentation::UndocumentedMethodArguments::Parser
- Inherits:
-
Parsers::Base
- Object
- Parsers::Base
- Yard::Lint::Validators::Documentation::UndocumentedMethodArguments::Parser
- Defined in:
- lib/yard/lint/validators/documentation/undocumented_method_arguments/parser.rb
Overview
Class used to extract details about methods with undocumented arguments
Constant Summary collapse
- LOCATION_REGEX =
Regex to extract file, line, and method name from yard list output Format: /path/to/file.rb:10: ClassName#method_name
/^(.+):(\d+):\s+(.+)[#.](.+)$/
Instance Method Summary collapse
-
#call(yard_list) ⇒ Array<Hash>
Array with undocumented method arguments details.
Methods inherited from Parsers::Base
Instance Method Details
#call(yard_list) ⇒ Array<Hash>
Returns Array with undocumented method arguments details.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/yard/lint/validators/documentation/undocumented_method_arguments/parser.rb', line 18 def call(yard_list) yard_list .split("\n") .reject(&:empty?) .filter_map do |line| match_data = line.match(LOCATION_REGEX) next unless match_data # Extract: file path, line number, class name, method name file_path = match_data[1] line_number = match_data[2].to_i class_name = match_data[3] method_name = match_data[4] { location: file_path, method_name: method_name, line: line_number, class_name: class_name } end end |