Class: SvgConform::References::BaseReference
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- SvgConform::References::BaseReference
- Defined in:
- lib/svg_conform/references/base_reference.rb
Overview
Base class for all reference types
Direct Known Subclasses
DataUriReference, ExternalUrlReference, InternalFragmentReference, RelativePathReference, UrnReference
Instance Method Summary collapse
-
#internally_validatable? ⇒ Boolean
Can this reference be validated internally by svg_conform?.
-
#requires_consumer_validation? ⇒ Boolean
Should this be deferred to consumer for validation?.
- #to_h ⇒ Object
-
#validation_scope ⇒ Object
Abstract method - defines validation scope.
Instance Method Details
#internally_validatable? ⇒ Boolean
Can this reference be validated internally by svg_conform?
37 38 39 |
# File 'lib/svg_conform/references/base_reference.rb', line 37 def internally_validatable? validation_scope == :internal end |
#requires_consumer_validation? ⇒ Boolean
Should this be deferred to consumer for validation?
42 43 44 |
# File 'lib/svg_conform/references/base_reference.rb', line 42 def requires_consumer_validation? validation_scope == :external end |
#to_h ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/svg_conform/references/base_reference.rb', line 46 def to_h { type: self.class.name.split("::").last, value: value, element_name: element_name, attribute_name: attribute_name, line_number: line_number, column_number: column_number, validation_scope: validation_scope, } end |
#validation_scope ⇒ Object
Abstract method - defines validation scope
32 33 34 |
# File 'lib/svg_conform/references/base_reference.rb', line 32 def validation_scope raise NotImplementedError, "Subclasses must define validation scope" end |