Class: RuboCop::RSpec::DescriptionExtractor::CodeObject
- Inherits:
-
Object
- Object
- RuboCop::RSpec::DescriptionExtractor::CodeObject
- Defined in:
- lib/rubocop/rspec/description_extractor.rb
Overview
Decorator of a YARD code object for working with documented rspec cops
Constant Summary collapse
- RSPEC_COP_CLASS_NAME =
'RuboCop::Cop::RSpec::Base'
- RUBOCOP_COP_CLASS_NAME =
'RuboCop::Cop::Base'
- RSPEC_NAMESPACE =
'RuboCop::Cop::RSpec'
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.
28 29 30 |
# File 'lib/rubocop/rspec/description_extractor.rb', line 28 def initialize(yardoc) @yardoc = yardoc end |
Instance Method Details
#configuration ⇒ Hash
Configuration for the documented cop that would live in default.yml
42 43 44 |
# File 'lib/rubocop/rspec/description_extractor.rb', line 42 def configuration { cop_name => { 'Description' => description } } end |
#rspec_cop? ⇒ Boolean
Test if the YARD code object documents a concrete rspec cop class
35 36 37 |
# File 'lib/rubocop/rspec/description_extractor.rb', line 35 def rspec_cop? cop_subclass? && !abstract? && rspec_cop_namespace? end |