Class: Docbook::Services::Linter
- Inherits:
-
Object
- Object
- Docbook::Services::Linter
- Defined in:
- lib/docbook/services/linter.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #check(strict: false) ⇒ Object
-
#initialize(document, input_path: nil) ⇒ Linter
constructor
A new instance of Linter.
- #ok? ⇒ Boolean
Constructor Details
#initialize(document, input_path: nil) ⇒ Linter
Returns a new instance of Linter.
8 9 10 11 12 13 |
# File 'lib/docbook/services/linter.rb', line 8 def initialize(document, input_path: nil) @document = document @input_path = input_path @errors = [] @warnings = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/docbook/services/linter.rb', line 6 def errors @errors end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
6 7 8 |
# File 'lib/docbook/services/linter.rb', line 6 def warnings @warnings end |
Instance Method Details
#check(strict: false) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/docbook/services/linter.rb', line 15 def check(strict: false) check_duplicate_ids check_empty_elements if strict check_broken_xrefs check_missing_images end self end |
#ok? ⇒ Boolean
25 26 27 |
# File 'lib/docbook/services/linter.rb', line 25 def ok? @errors.empty? end |