Class: RuboCop::FactoryBot::DescriptionExtractor::CodeObject
- Inherits:
-
Object
- Object
- RuboCop::FactoryBot::DescriptionExtractor::CodeObject
- Defined in:
- lib/rubocop/factory_bot/description_extractor.rb
Overview
Decorator of a YARD code object for working with documented cops
Constant Summary collapse
- RUBOCOP_COP_CLASS_NAME =
'RuboCop::Cop::Base'
Instance Method Summary collapse
-
#configuration ⇒ Hash
Configuration for the documented cop that would live in default.yml.
-
#cop? ⇒ Boolean
Test if the YARD code object documents a concrete cop class.
-
#initialize(yardoc) ⇒ CodeObject
constructor
A new instance of CodeObject.
Constructor Details
#initialize(yardoc) ⇒ CodeObject
Returns a new instance of CodeObject.
26 27 28 |
# File 'lib/rubocop/factory_bot/description_extractor.rb', line 26 def initialize(yardoc) @yardoc = yardoc end |
Instance Method Details
#configuration ⇒ Hash
Configuration for the documented cop that would live in default.yml
40 41 42 |
# File 'lib/rubocop/factory_bot/description_extractor.rb', line 40 def configuration { cop_name => { 'Description' => description } } end |
#cop? ⇒ Boolean
Test if the YARD code object documents a concrete cop class
33 34 35 |
# File 'lib/rubocop/factory_bot/description_extractor.rb', line 33 def cop? cop_subclass? && !abstract? end |