Class: RuboCop::FactoryBot::DescriptionExtractor
- Inherits:
-
Object
- Object
- RuboCop::FactoryBot::DescriptionExtractor
- Defined in:
- lib/rubocop/factory_bot/description_extractor.rb
Overview
Extracts cop descriptions from YARD docstrings
Defined Under Namespace
Classes: CodeObject
Instance Method Summary collapse
-
#initialize(yardocs) ⇒ DescriptionExtractor
constructor
A new instance of DescriptionExtractor.
- #to_h ⇒ Object
Constructor Details
#initialize(yardocs) ⇒ DescriptionExtractor
Returns a new instance of DescriptionExtractor.
7 8 9 |
# File 'lib/rubocop/factory_bot/description_extractor.rb', line 7 def initialize(yardocs) @code_objects = yardocs.map(&CodeObject.public_method(:new)) end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 |
# File 'lib/rubocop/factory_bot/description_extractor.rb', line 11 def to_h code_objects .select(&:cop?) .map(&:configuration) .reduce(:merge) end |