Class ViolationDetector
In: lib/kwala/actions/code_formatting.rb
Parent: Object

Methods

Attributes

violation_rec  [RW] 

Public Class methods

Public Instance methods

Add a specific instance of a detector to use when checking for violations.

Checks for violations in a file.

Parameters

file:The path to a file to check.

Note: as Katagiri proposed we could make file an IO object to make this even more general and powerful.

If detector needs the whole file instead of the lines of the file, then it must overwrite this method to return false.

Return detectors used for checking. If no detectors were specifically added, then an instance of each subclass of ViolationDetector is returned.

Protected Instance methods

If uses_lines returns false implement this method to check against the path to a file.

Implement this method to check against a line in a file. Return either a violation instance or nil if no violation found.

Overwrite this method to check against all lines in file. If you want to just check one line then use check_line. Return an array of violation, if no violations return an empty array.

[Validate]