Class: ROM::Lint::Linter
- Inherits:
-
Object
- Object
- ROM::Lint::Linter
- Defined in:
- core/lib/rom/lint/linter.rb
Overview
Base class for building linters that check source code
Linters are used by authors of ROM adapters to verify that their integration complies with the ROM api.
Most of the time, authors won't need to construct linters directly because the provided test helpers will automatically run when required in tests and specs.
Direct Known Subclasses
Constant Summary collapse
- Failure =
A failure raised by +complain+
Class.new(StandardError)
Class Method Summary collapse
-
.each_lint {|String, ROM::Lint| ... } ⇒ Object
Iterate over all lint methods.
Instance Method Summary collapse
-
#lint(name) ⇒ Object
Run a lint method.
Class Method Details
.each_lint {|String, ROM::Lint| ... } ⇒ Object
Iterate over all lint methods
28 29 30 31 32 |
# File 'core/lib/rom/lint/linter.rb', line 28 def self.each_lint return to_enum unless block_given? lints.each { |lint| yield lint, self } end |
Instance Method Details
#lint(name) ⇒ Object
Run a lint method
41 42 43 44 45 46 |
# File 'core/lib/rom/lint/linter.rb', line 41 def lint(name) before_lint public_send name after_lint true # for assertions end |