Class: Puppet::Pops::Binder::Config::DiagnosticProducer
- Defined in:
- lib/puppet/pops/binder/config/diagnostic_producer.rb
Overview
Generates validation diagnostics
Instance Method Summary collapse
- #accept(issue, semantic, arguments = {}) ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(acceptor) ⇒ DiagnosticProducer
constructor
A new instance of DiagnosticProducer.
- #severity_producer ⇒ Object
Constructor Details
#initialize(acceptor) ⇒ DiagnosticProducer
Returns a new instance of DiagnosticProducer.
4 5 6 7 |
# File 'lib/puppet/pops/binder/config/diagnostic_producer.rb', line 4 def initialize(acceptor) @acceptor = acceptor @severity_producer = Puppet::Pops::Validation::SeverityProducer.new end |
Instance Method Details
#accept(issue, semantic, arguments = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/puppet/pops/binder/config/diagnostic_producer.rb', line 9 def accept(issue, semantic, arguments={}) arguments[:semantic] ||= semantic severity = severity_producer.severity(issue) @acceptor.accept(Puppet::Pops::Validation::Diagnostic.new(severity, issue, nil, nil, arguments)) end |
#errors? ⇒ Boolean
15 16 17 |
# File 'lib/puppet/pops/binder/config/diagnostic_producer.rb', line 15 def errors?() @acceptor.errors? end |
#severity_producer ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/puppet/pops/binder/config/diagnostic_producer.rb', line 19 def severity_producer p = @severity_producer # All are errors, if there is need to mark some as warnings... # p[Issues::XXX] = :warning # ignored because there is a default p[Puppet::Pops::Binder::Config::Issues::CONFIG_LAYERS_MISSING] = :ignore # ignored because there is a default p[Puppet::Pops::Binder::Config::Issues::CONFIG_CATEGORIES_MISSING] = :ignore p end |