Class: Yamlint::Rules::TokenRule

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



73
74
75
76
77
78
79
80
# File 'lib/yamlint/rules/base.rb', line 73

def check(context)
  problems = []
  context.tokens.each do |token|
    token_problems = check_token(token, context)
    problems.concat(Array(token_problems))
  end
  problems
end

#check_token(_token, _context) ⇒ Object

Raises:

  • (NotImplementedError)


82
83
84
# File 'lib/yamlint/rules/base.rb', line 82

def check_token(_token, _context)
  raise NotImplementedError, "#{self.class}#check_token must be implemented"
end