Skip to content

Files

Latest commit

 

History

History
45 lines (35 loc) · 672 Bytes

Lint-MissingSuper.md

File metadata and controls

45 lines (35 loc) · 672 Bytes

Pattern: Missing use of super

Issue: -

Description

This rule checks for the presence of constructors and life-cycle callbacks without calls to super.

Examples

# bad
class Employee < Person
  def initialize(name, salary)
    @salary = salary
  end
end

# good
class Employee < Person
  def initialize(name, salary)
    super(name)
    @salary = salary
  end
end

# bad
class Parent
  def self.inherited(base)
    do_something
  end
end

# good
class Parent
  def self.inherited(base)
    super
    do_something
  end
end

Further Reading