Class: Laser::ExtraWhitespaceWarning
- Inherits:
-
LineWarning
- Object
- Struct
- Warning
- LineWarning
- Laser::ExtraWhitespaceWarning
- Defined in:
- lib/laser/warnings/extra_whitespace.rb
Overview
Warning for having extra space at the end of a line.
Instance Attribute Summary
Attributes inherited from Warning
#body, #file, #line_number, #name, #severity
Instance Method Summary (collapse)
Methods inherited from LineWarning
Instance Method Details
- (Object) fix
13 14 15 |
# File 'lib/laser/warnings/extra_whitespace.rb', line 13 def fix self.line.gsub(/\s+$/, '') end |
- (Boolean) match?(body = self.body)
9 10 11 |
# File 'lib/laser/warnings/extra_whitespace.rb', line 9 def match?(body = self.body) /\s+$/ === line end |