Class: Lutaml::Xsd::NamespacePrefixInfo
- Inherits:
-
Object
- Object
- Lutaml::Xsd::NamespacePrefixInfo
- Defined in:
- lib/lutaml/xsd/namespace_prefix_manager.rb
Overview
Value object for namespace prefix information
Instance Attribute Summary collapse
-
#original_schema_location ⇒ Object
readonly
Returns the value of attribute original_schema_location.
-
#package_location ⇒ Object
readonly
Returns the value of attribute package_location.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#type_count ⇒ Object
readonly
Returns the value of attribute type_count.
-
#types_by_category ⇒ Object
readonly
Returns the value of attribute types_by_category.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(mapping, repository) ⇒ NamespacePrefixInfo
constructor
A new instance of NamespacePrefixInfo.
-
#to_h ⇒ Hash
Convert to hash for JSON/YAML output.
Constructor Details
#initialize(mapping, repository) ⇒ NamespacePrefixInfo
Returns a new instance of NamespacePrefixInfo.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 54 def initialize(mapping, repository) @prefix = mapping.prefix @uri = mapping.uri # Get schema location information manager = NamespacePrefixManager.new(repository) @package_location = manager.get_package_location(@uri) @original_schema_location = extract_original_location(repository) # Get type statistics types = repository.send(:types_in_namespace, @uri) @type_count = types.size @types_by_category = count_types_by_category(types) end |
Instance Attribute Details
#original_schema_location ⇒ Object (readonly)
Returns the value of attribute original_schema_location.
51 52 53 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 51 def original_schema_location @original_schema_location end |
#package_location ⇒ Object (readonly)
Returns the value of attribute package_location.
51 52 53 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 51 def package_location @package_location end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
51 52 53 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 51 def prefix @prefix end |
#type_count ⇒ Object (readonly)
Returns the value of attribute type_count.
51 52 53 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 51 def type_count @type_count end |
#types_by_category ⇒ Object (readonly)
Returns the value of attribute types_by_category.
51 52 53 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 51 def types_by_category @types_by_category end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
51 52 53 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 51 def uri @uri end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash for JSON/YAML output
71 72 73 74 75 76 77 78 79 80 |
# File 'lib/lutaml/xsd/namespace_prefix_manager.rb', line 71 def to_h { prefix: prefix, uri: uri, original_schema_location: original_schema_location, package_location: package_location, type_count: type_count, types_by_category: types_by_category, } end |