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.
-
#without_type(type) ⇒ Array<Cop>
Cops not for a specific type.
Instance Method Details
#types ⇒ Array<String>
Returns list of types for current cops.
11 12 13 14 |
# File 'lib/rubocop/cop/cop.rb', line 11 def types @types = map(&:cop_type).uniq! unless defined? @types @types end |
#with_type(type) ⇒ Array<Cop>
Returns Cops for that specific type.
17 18 19 |
# File 'lib/rubocop/cop/cop.rb', line 17 def with_type(type) select { |c| c.cop_type == type } end |
#without_type(type) ⇒ Array<Cop>
Returns Cops not for a specific type.
22 23 24 |
# File 'lib/rubocop/cop/cop.rb', line 22 def without_type(type) reject { |c| c.cop_type == type } end |