Class: RuboCop::EightyFourCodes::DescriptionExtractor::CodeObject
- Inherits:
-
Object
- Object
- RuboCop::EightyFourCodes::DescriptionExtractor::CodeObject
- Defined in:
- lib/rubocop/eightyfourcodes/description_extractor.rb
Overview
Decorator of a YARD code object for working with documented rspec cops
Constant Summary collapse
- RSPEC_NAMESPACE =
'RuboCop::Cop::eightyfourcodes'.freeze
Instance Method Summary collapse
-
#configuration ⇒ Hash
Configuration for the documented cop that would live in default.yml.
-
#initialize(yardoc) ⇒ CodeObject
constructor
A new instance of CodeObject.
-
#rspec_cop? ⇒ Boolean
Test if the YARD code object documents a concrete rspec cop class.
Constructor Details
#initialize(yardoc) ⇒ CodeObject
Returns a new instance of CodeObject.
24 25 26 |
# File 'lib/rubocop/eightyfourcodes/description_extractor.rb', line 24 def initialize(yardoc) @yardoc = yardoc end |
Instance Method Details
#configuration ⇒ Hash
Configuration for the documented cop that would live in default.yml
38 39 40 |
# File 'lib/rubocop/eightyfourcodes/description_extractor.rb', line 38 def configuration { cop_name => { 'Description' => description } } end |
#rspec_cop? ⇒ Boolean
Test if the YARD code object documents a concrete rspec cop class
31 32 33 |
# File 'lib/rubocop/eightyfourcodes/description_extractor.rb', line 31 def rspec_cop? class_documentation? && rspec_cop_namespace? && !abstract? end |