Provides a binding of arguments passed to Puppet::Pops::Issues::Issue#format to method names available in the issue’s message producing block. @api private
# File lib/puppet/pops/issues.rb, line 62 def initialize *argnames singleton = class << self; self end argnames.each do |name| singleton.send(:define_method, name) do @data[name] end end end
# File lib/puppet/pops/issues.rb, line 71 def format(hash, &block) @data = hash instance_eval &block end
Returns the label provider given as a key in the hash passed to format. If given an argument, calls label on the label provider (caller would otherwise have to call label.label(it)
# File lib/puppet/pops/issues.rb, line 80 def label(it = nil) raise "Label provider key :label must be set to produce the text of the message!" unless @data[:label] it.nil? ? @data[:label] : @data[:label].label(it) end
Returns the label provider given as a key in the hash passed to format.
# File lib/puppet/pops/issues.rb, line 87 def semantic raise "Label provider key :semantic must be set to produce the text of the message!" unless @data[:semantic] @data[:semantic] end