Class: Rubocop::Cop::CopStore
- Inherits:
-
Array
- Object
- Array
- Rubocop::Cop::CopStore
- Defined in:
- lib/rubocop/cop/cop.rb
Overview
Store for all cops with helper functions
Instance Method Summary collapse
-
#types ⇒ Array<String>
List of types for current cops.
-
#with_type(type) ⇒ Array<Cop>
Cops for that specific type.
Instance Method Details
#types ⇒ Array<String>
Returns list of types for current cops.
9 10 11 12 |
# File 'lib/rubocop/cop/cop.rb', line 9 def types @types = map(&:cop_type).uniq! unless defined? @types @types end |
#with_type(type) ⇒ Array<Cop>
Returns Cops for that specific type.
15 16 17 |
# File 'lib/rubocop/cop/cop.rb', line 15 def with_type(type) select { |c| c.cop_type == type } end |