class RuboCop::Cop::Style::DataInheritance

Checks for inheritance from ‘Data.define` to avoid creating the anonymous parent class. Inheriting from `Data.define` adds a superfluous level in inheritance tree.

@safety

Autocorrection is unsafe because it will change the inheritance
tree (e.g. return value of `Module#ancestors`) of the constant.

@example

# bad
class Person < Data.define(:first_name, :last_name)
  def age
    42
  end
end

Person.ancestors
# => [Person, #<Class:0x000000010b4e14a0>, Data, (...)]

# good
Person = Data.define(:first_name, :last_name) do
  def age
    42
  end
end

Person.ancestors
# => [Person, Data, (...)]