Method: RuboCop::Cop::Style::StructInheritance#on_class
- Defined in:
- lib/rubocop/cop/style/struct_inheritance.rb
#on_class(node) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/rubocop/cop/style/struct_inheritance.rb', line 40 def on_class(node) return unless struct_constructor?(node.parent_class) add_offense(node.parent_class) do |corrector| corrector.remove(range_with_surrounding_space(node.loc.keyword, newlines: false)) corrector.replace(node.loc.operator, '=') correct_parent(node.parent_class, corrector) end end |