Class: Glossarist::Validation::Rules::ConceptIdRule

Inherits:
Base
  • Object
show all
Defined in:
lib/glossarist/validation/rules/concept_id_rule.rb

Instance Method Summary collapse

Methods inherited from Base

#applicable?, inherited, #severity

Instance Method Details

#categoryObject



8
# File 'lib/glossarist/validation/rules/concept_id_rule.rb', line 8

def category = :structure

#check(context) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/glossarist/validation/rules/concept_id_rule.rb', line 11

def check(context)
  concept = context.concept
  fname = context.file_name
  issues = []

  id = concept.data&.id
  unless id
    issues << issue("#{fname}: missing concept id",
                    code: code, severity: "error")
    return issues
  end

  issues
end

#codeObject



7
# File 'lib/glossarist/validation/rules/concept_id_rule.rb', line 7

def code = "GLS-001"

#scopeObject



9
# File 'lib/glossarist/validation/rules/concept_id_rule.rb', line 9

def scope = :concept