Class: Glossarist::Validation::Rules::DateTypeRule
- Defined in:
- lib/glossarist/validation/rules/date_type_rule.rb
Constant Summary collapse
- VALID_TYPES =
Glossarist::GlossaryDefinition::CONCEPT_DATE_TYPES
Instance Method Summary collapse
- #applicable?(context) ⇒ Boolean
- #category ⇒ Object
- #check(context) ⇒ Object
- #code ⇒ Object
- #scope ⇒ Object
- #severity ⇒ Object
Methods inherited from Base
Instance Method Details
#applicable?(context) ⇒ Boolean
14 15 16 17 |
# File 'lib/glossarist/validation/rules/date_type_rule.rb', line 14 def applicable?(context) concept = context.concept (concept.dates&.any?) || concept.date_accepted end |
#category ⇒ Object
8 |
# File 'lib/glossarist/validation/rules/date_type_rule.rb', line 8 def category = :schema |
#check(context) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/glossarist/validation/rules/date_type_rule.rb', line 19 def check(context) concept = context.concept fname = context.file_name issues = [] check_date_collection(concept.dates, fname, issues) if concept.date_accepted && concept.date_accepted.type validate_date_type(concept.date_accepted, "date_accepted", fname, issues) end issues end |
#code ⇒ Object
7 |
# File 'lib/glossarist/validation/rules/date_type_rule.rb', line 7 def code = "GLS-205" |
#scope ⇒ Object
10 |
# File 'lib/glossarist/validation/rules/date_type_rule.rb', line 10 def scope = :concept |
#severity ⇒ Object
9 |
# File 'lib/glossarist/validation/rules/date_type_rule.rb', line 9 def severity = "warning" |