Class: Tailor::Rulers::AllowHardTabsRuler
- Inherits:
-
Tailor::Ruler
- Object
- Tailor::Ruler
- Tailor::Rulers::AllowHardTabsRuler
- Defined in:
- lib/tailor/rulers/allow_hard_tabs_ruler.rb
Instance Attribute Summary
Attributes inherited from Tailor::Ruler
Instance Method Summary collapse
-
#initialize(config, options) ⇒ AllowHardTabsRuler
constructor
A new instance of AllowHardTabsRuler.
-
#measure(token, lineno, column) ⇒ Object
Checks to see if the space(s) contains hard tabs.
- #sp_update(token, lineno, column) ⇒ Object
Methods inherited from Tailor::Ruler
#add_child_ruler, #problem_type, #problems
Methods included from Logger::Mixin
Constructor Details
#initialize(config, options) ⇒ AllowHardTabsRuler
Returns a new instance of AllowHardTabsRuler.
6 7 8 9 |
# File 'lib/tailor/rulers/allow_hard_tabs_ruler.rb', line 6 def initialize(config, ) super(config, ) add_lexer_observers :sp end |
Instance Method Details
#measure(token, lineno, column) ⇒ Object
Checks to see if the space(s) contains hard tabs.
20 21 22 23 24 25 26 27 |
# File 'lib/tailor/rulers/allow_hard_tabs_ruler.rb', line 20 def measure(token, lineno, column) if token.contains_hard_tab? = 'Hard tab found.' @problems << Problem.new(problem_type, lineno, column, , @options[:level]) end end |
#sp_update(token, lineno, column) ⇒ Object
11 12 13 |
# File 'lib/tailor/rulers/allow_hard_tabs_ruler.rb', line 11 def sp_update(token, lineno, column) measure(token, lineno, column) end |