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