Class: RuboCop::Schema::DefaultsRipper
- Inherits:
-
Object
- Object
- RuboCop::Schema::DefaultsRipper
- Defined in:
- lib/rubocop/schema/defaults_ripper.rb
Constant Summary collapse
- EXCLUDE_ATTRIBUTES =
Set.new(%w[Description VersionAdded VersionChanged StyleGuide]).freeze
- TYPE_MAP =
{ integer: [Integer], number: [Float], boolean: [TrueClass, FalseClass], string: [String], array: [Array] }.freeze
Instance Attribute Summary collapse
- #cops ⇒ Array<CopInfo> readonly
Instance Method Summary collapse
-
#initialize(defaults) ⇒ DefaultsRipper
constructor
A new instance of DefaultsRipper.
Constructor Details
#initialize(defaults) ⇒ DefaultsRipper
Returns a new instance of DefaultsRipper.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rubocop/schema/defaults_ripper.rb', line 20 def initialize(defaults) @cops = defaults.map do |cop_name, attributes| next unless attributes.is_a? Hash CopInfo.new( name: cop_name, description: attributes['Description'], enabled_by_default: attributes['Enabled'] == true, attributes: transform_attributes(attributes) ) end.compact end |
Instance Attribute Details
#cops ⇒ Array<CopInfo> (readonly)
17 18 19 |
# File 'lib/rubocop/schema/defaults_ripper.rb', line 17 def cops @cops end |