Class: Glossarist::Validation::Rules::LocalizationPresenceRule

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

Instance Method Summary collapse

Methods inherited from Base

#applicable?, inherited, #severity

Instance Method Details

#categoryObject



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

def category = :structure

#check(context) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/glossarist/validation/rules/localization_presence_rule.rb', line 11

def check(context)
  concept = context.concept
  fname = context.file_name
  l10ns = concept.localizations&.values || []

  return [] if l10ns.any?

  [issue("#{fname}: no localizations found",
         code: code, severity: "warning")]
end

#codeObject



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

def code = "GLS-002"

#scopeObject



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

def scope = :concept