Class: Lutaml::Model::Validation::Issue

Inherits:
Serializable show all
Defined in:
lib/lutaml/model/validation/issue.rb

Overview

Serializable validation issue with severity, code, location, and suggestion. Used by Rule#check to report problems and aggregated by LayerResult and Report.

Constant Summary collapse

SEVERITIES =

Allowed severity levels for validation issues.

%w[error warning info notice].freeze

Constants included from Serialize

Serialize::DEFAULT_VALUE_MAP, Serialize::INTERNAL_ATTRIBUTES, Serialize::LAZY_EMPTY_COLLECTION

Instance Attribute Summary

Attributes included from Serialize

#lutaml_parent, #lutaml_register, #lutaml_root

Instance Method Summary collapse

Methods included from Serialize

#attr_value, #attribute_exist?, #extract_register_id, included, #init_deserialization_state, #key_exist?, #key_value, #method_missing, #prepare_instance_format_options, #pretty_print_instance_variables, register_format_mapping_method, register_from_format_method, register_to_format_method, #respond_to_missing?, #to_format, #to_yaml_hash, #using_default?, #using_default_for, #validate_attribute!, #validate_root_mapping!, #value_map, #value_set_for

Methods included from Liquefiable

included, #to_liquid

Methods included from Lutaml::Model::Validation

#format_element_sequences, new_registry, #order_names, #validate, validate, #validate!, validate!, #validate_helper, #validate_sequence!

Methods included from ComparableModel

#already_compared?, #attributes_hash, #calculate_hash, #comparison_key, #eql?, #hash, included, #same_class?

Methods included from Serialize::Builder

#mixed_content?

Constructor Details

#initialize(attributes = {}) ⇒ Issue

Returns a new instance of Issue.



29
30
31
32
# File 'lib/lutaml/model/validation/issue.rb', line 29

def initialize(attributes = {})
  super
  validate_severity!
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Lutaml::Model::Serialize

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/lutaml/model/validation/issue.rb', line 34

def error?
  severity == "error"
end

#info?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/lutaml/model/validation/issue.rb', line 42

def info?
  severity == "info"
end

#notice?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/lutaml/model/validation/issue.rb', line 46

def notice?
  severity == "notice"
end

#warning?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/lutaml/model/validation/issue.rb', line 38

def warning?
  severity == "warning"
end