Module: Packwerk::Checker Abstract

Included in:
ReferenceChecking::Checkers::DependencyChecker
Defined in:
lib/packwerk/checker.rb

Overview

This module is abstract.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.allObject

: -> Array



14
15
16
17
# File 'lib/packwerk/checker.rb', line 14

def all
  load_defaults
  checkers.map(&:new) #: as Array[Checker]
end

.find(violation_type) ⇒ Object

: (String violation_type) -> Checker



20
21
22
# File 'lib/packwerk/checker.rb', line 20

def find(violation_type)
  checker_by_violation_type(violation_type)
end

.included(base) ⇒ Object

: (Class base) -> void



9
10
11
# File 'lib/packwerk/checker.rb', line 9

def included(base)
  checkers << base
end

Instance Method Details

#invalid_reference?(reference) ⇒ Boolean

This method is abstract.

: (Reference reference) -> bool

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


55
# File 'lib/packwerk/checker.rb', line 55

def invalid_reference?(reference) = raise NotImplementedError, "Abstract method called"

#message(reference) ⇒ Object

This method is abstract.

: (Reference reference) -> String

Raises:

  • (NotImplementedError)


59
# File 'lib/packwerk/checker.rb', line 59

def message(reference) = raise NotImplementedError, "Abstract method called"

#strict_mode_violation?(offense) ⇒ Boolean

This method is abstract.

: (ReferenceOffense offense) -> bool

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


51
# File 'lib/packwerk/checker.rb', line 51

def strict_mode_violation?(offense) = raise NotImplementedError, "Abstract method called"

#violation_typeObject

This method is abstract.

: -> String

Raises:

  • (NotImplementedError)


47
# File 'lib/packwerk/checker.rb', line 47

def violation_type = raise NotImplementedError, "Abstract method called"