Class: Playgroundbook::AbstractLinter

Inherits:
Object
  • Object
show all
Defined in:
lib/linter/abstract_linter.rb

Overview

AbstractLinter provides a base implementation of a linter which a concrete linter subclass can inherit from

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.uiObject

Returns the value of attribute ui.



11
12
13
# File 'lib/linter/abstract_linter.rb', line 11

def ui
  @ui
end

Instance Method Details

#fail_lint(msg) ⇒ Object



14
15
16
17
# File 'lib/linter/abstract_linter.rb', line 14

def fail_lint(msg)
  AbstractLinter.ui.puts msg.red
  exit 1
end

#message(msg) ⇒ Object



19
20
21
# File 'lib/linter/abstract_linter.rb', line 19

def message(msg)
  AbstractLinter.ui.puts msg
end