Class: Kiba::Extend::Registry::RegistryValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/kiba/extend/registry/registry_validator.rb

Overview

Utility class to report on the validity of the FileRegistry.

Since:

  • 2.2.0

Instance Method Summary collapse

Instance Method Details

#reportObject

Prints to STDOUT a report of errors and warnings to inform needed development in project applications

Since:

  • 2.2.0



11
12
13
14
15
# File 'lib/kiba/extend/registry/registry_validator.rb', line 11

def report
  puts ""
  report_validity
  report_warnings
end

#valid?TrueClass, FalseClass

Check validity of the registry as a whole

Returns:

  • (TrueClass)

    if all Entries are valid

  • (FalseClass)

    is any Entries are invalid

Since:

  • 2.2.0



20
21
22
23
24
# File 'lib/kiba/extend/registry/registry_validator.rb', line 20

def valid?
  return true if invalid.empty?

  false
end

#warnings?TrueClass, FalseClass

Whether any entries have warnings

Returns:

  • (TrueClass)

    if any Entries have warnings

  • (FalseClass)

    is no Entries have warnings

Since:

  • 2.2.0



29
30
31
32
33
# File 'lib/kiba/extend/registry/registry_validator.rb', line 29

def warnings?
  return false if warnings.empty?

  true
end