Class: Puppet::Pops::Validation::Diagnostic Private
- Defined in:
- lib/puppet/pops/validation.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #arguments ⇒ Object readonly private
- #exception ⇒ Object readonly private
- #file ⇒ Object readonly private
- #issue ⇒ Object readonly private
- #severity ⇒ Object readonly private
- #source_pos ⇒ Object readonly private
Instance Method Summary collapse
-
#==(o) ⇒ Object
(also: #eql?)
private
Two diagnostics are considered equal if the have the same issue, location and severity (arguments and exception are ignored).
- #hash ⇒ Object private
-
#initialize(severity, issue, file, source_pos, arguments = {}, exception = nil) ⇒ Diagnostic
constructor
private
A new instance of Diagnostic.
Constructor Details
#initialize(severity, issue, file, source_pos, arguments = {}, exception = nil) ⇒ Diagnostic
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Diagnostic.
227 228 229 230 231 232 233 234 235 236 |
# File 'lib/puppet/pops/validation.rb', line 227 def initialize severity, issue, file, source_pos, arguments={}, exception=nil @severity = severity @issue = issue @file = file @source_pos = source_pos @arguments = arguments # TODO: Currently unused, the intention is to provide more information (stack backtrace, etc.) when # debugging or similar - this to catch internal problems reported as higher level issues. @exception = exception end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
223 224 225 |
# File 'lib/puppet/pops/validation.rb', line 223 def arguments @arguments end |
#exception ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
224 225 226 |
# File 'lib/puppet/pops/validation.rb', line 224 def exception @exception end |
#file ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
225 226 227 |
# File 'lib/puppet/pops/validation.rb', line 225 def file @file end |
#issue ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
222 223 224 |
# File 'lib/puppet/pops/validation.rb', line 222 def issue @issue end |
#severity ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
221 222 223 |
# File 'lib/puppet/pops/validation.rb', line 221 def severity @severity end |
#source_pos ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
226 227 228 |
# File 'lib/puppet/pops/validation.rb', line 226 def source_pos @source_pos end |
Instance Method Details
#==(o) ⇒ Object Also known as: eql?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Two diagnostics are considered equal if the have the same issue, location and severity (arguments and exception are ignored)
241 242 243 244 245 246 247 |
# File 'lib/puppet/pops/validation.rb', line 241 def ==(o) self.class == o.class && same_position?(o) && issue.issue_code == o.issue.issue_code && file == o.file && severity == o.severity end |
#hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
256 257 258 |
# File 'lib/puppet/pops/validation.rb', line 256 def hash @hash ||= [file, source_pos.offset, issue.issue_code, severity].hash end |