Class: Yamlint::Rules::LineRule

Inherits:
Base
  • Object
show all
Defined in:
lib/yamlint/rules/base.rb

Instance Attribute Summary

Attributes inherited from Base

#config, #level

Instance Method Summary collapse

Methods inherited from Base

defaults, desc, #fixable?, inherited, #initialize, rule_id

Constructor Details

This class inherits a constructor from Yamlint::Rules::Base

Instance Method Details

#check(context) ⇒ Object



57
58
59
60
61
62
63
64
65
# File 'lib/yamlint/rules/base.rb', line 57

def check(context)
  problems = []
  context.lines.each_with_index do |line, index|
    line_number = index + 1
    line_problems = check_line(line, line_number, context)
    problems.concat(Array(line_problems))
  end
  problems
end

#check_line(_line, _line_number, _context) ⇒ Object

Raises:

  • (NotImplementedError)


67
68
69
# File 'lib/yamlint/rules/base.rb', line 67

def check_line(_line, _line_number, _context)
  raise NotImplementedError, "#{self.class}#check_line must be implemented"
end