Class: Wool::ExtraWhitespaceWarning
- Inherits:
-
LineWarning
- Object
- Struct
- Warning
- LineWarning
- Wool::ExtraWhitespaceWarning
- Defined in:
- lib/wool/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, #settings, #severity
Instance Method Summary collapse
Methods inherited from LineWarning
Methods inherited from Warning
all_types, all_warnings, concrete_warnings, #count_occurrences, #desc, #fixable?, #generated_warnings, #get_indent, #indent, inherited, #initialize, opt, options, setting_accessor, type
Methods included from Advice
#advice_counter, #after_advice, #argument_advice, #before_advice, #bump_advice_counter!, #with_advice
Methods included from ModuleExtensions
#attr_accessor_with_default, #cattr_accessor, #cattr_accessor_with_default, #cattr_get_and_setter, #cattr_reader, #cattr_writer
Methods included from SexpAnalysis
Methods included from LexicalAnalysis
#find_keyword, #find_token, #lex, #select_token, #split_on_keyword, #split_on_token, #text_between_token_positions
Constructor Details
This class inherits a constructor from Wool::Warning
Instance Method Details
#fix ⇒ Object
12 13 14 |
# File 'lib/wool/warnings/extra_whitespace.rb', line 12 def fix self.line.gsub(/\s+$/, '') end |
#match?(body = self.body) ⇒ Boolean
8 9 10 |
# File 'lib/wool/warnings/extra_whitespace.rb', line 8 def match?(body = self.body) /\s+$/ === line end |