Class: Lutaml::Xsd::NamespaceRemapper
- Inherits:
-
Object
- Object
- Lutaml::Xsd::NamespaceRemapper
- Defined in:
- lib/lutaml/xsd/namespace_remapper.rb
Overview
Remaps namespace prefixes in a package Single responsibility: create new package with updated prefixes
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
-
#initialize(repository) ⇒ NamespaceRemapper
constructor
A new instance of NamespaceRemapper.
-
#remap(changes) ⇒ SchemaRepository
Remap prefixes.
Constructor Details
#initialize(repository) ⇒ NamespaceRemapper
Returns a new instance of NamespaceRemapper.
10 11 12 |
# File 'lib/lutaml/xsd/namespace_remapper.rb', line 10 def initialize(repository) @repository = repository end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
8 9 10 |
# File 'lib/lutaml/xsd/namespace_remapper.rb', line 8 def repository @repository end |
Instance Method Details
#remap(changes) ⇒ SchemaRepository
Remap prefixes
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/lutaml/xsd/namespace_remapper.rb', line 17 def remap(changes) # Validate changes validate_changes(changes) # Apply changes to namespace mappings new_mappings = apply_changes(changes) # Create new repository with updated mappings repository_with_new_mappings(new_mappings) end |