Class: RubocopTodoCorrector::CopDocumentParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_todo_corrector/cop_document_parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_path:) ⇒ CopDocumentParser

Returns a new instance of CopDocumentParser.



19
20
21
22
23
# File 'lib/rubocop_todo_corrector/cop_document_parser.rb', line 19

def initialize(
  source_path:
)
  @source_path = source_path
end

Class Method Details

.call(source_path:) ⇒ Hash?

Parameters:

  • source_path (String)

Returns:

  • (Hash, nil)


10
11
12
13
14
15
16
# File 'lib/rubocop_todo_corrector/cop_document_parser.rb', line 10

def call(
  source_path:
)
  new(
    source_path:
  ).call
end

Instance Method Details

#callHash?

Returns:

  • (Hash, nil)


26
27
28
29
30
31
32
33
34
# File 'lib/rubocop_todo_corrector/cop_document_parser.rb', line 26

def call
  return unless yard_class_object

  {
    description:,
    examples:,
    safety:
  }
end