Class: KafoModuleLint::Linter
- Inherits:
-
Object
- Object
- KafoModuleLint::Linter
- Defined in:
- lib/kafo_module_lint/linter.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(path) ⇒ Linter
constructor
A new instance of Linter.
- #pass? ⇒ Boolean
- #puts_errors ⇒ Object
Constructor Details
#initialize(path) ⇒ Linter
Returns a new instance of Linter.
9 10 11 |
# File 'lib/kafo_module_lint/linter.rb', line 9 def initialize(path) @path = File.(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/kafo_module_lint/linter.rb', line 7 def path @path end |
Instance Method Details
#errors ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/kafo_module_lint/linter.rb', line 17 def errors @errors ||= begin errors = [] parsed[:types].each do |param,type| check_param(param, type, errors) end unless skip? errors end end |
#pass? ⇒ Boolean
13 14 15 |
# File 'lib/kafo_module_lint/linter.rb', line 13 def pass? skip? || errors.empty? end |
#puts_errors ⇒ Object
27 28 29 |
# File 'lib/kafo_module_lint/linter.rb', line 27 def puts_errors errors.each { |e| puts e } end |