Class: Lutaml::Model::SchemaLocation
- Inherits:
-
Object
- Object
- Lutaml::Model::SchemaLocation
- Defined in:
- lib/lutaml/model/schema_location.rb
Constant Summary collapse
- DEFAULT_NAMESPACE =
"http://www.w3.org/2001/XMLSchema-instance".freeze
Instance Attribute Summary collapse
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#schema_location ⇒ Object
readonly
Returns the value of attribute schema_location.
Instance Method Summary collapse
- #[](index) ⇒ Object
-
#initialize(schema_location:, prefix: "xsi", namespace: DEFAULT_NAMESPACE) ⇒ SchemaLocation
constructor
A new instance of SchemaLocation.
- #size ⇒ Object
- #to_xml_attributes ⇒ Object
Constructor Details
#initialize(schema_location:, prefix: "xsi", namespace: DEFAULT_NAMESPACE) ⇒ SchemaLocation
28 29 30 31 32 33 34 |
# File 'lib/lutaml/model/schema_location.rb', line 28 def initialize(schema_location:, prefix: "xsi", namespace: DEFAULT_NAMESPACE) @original_schema_location = schema_location @schema_location = parsed_schema_locations(schema_location) @prefix = prefix @namespace = namespace end |
Instance Attribute Details
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
26 27 28 |
# File 'lib/lutaml/model/schema_location.rb', line 26 def namespace @namespace end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
26 27 28 |
# File 'lib/lutaml/model/schema_location.rb', line 26 def prefix @prefix end |
#schema_location ⇒ Object (readonly)
Returns the value of attribute schema_location.
26 27 28 |
# File 'lib/lutaml/model/schema_location.rb', line 26 def schema_location @schema_location end |
Instance Method Details
#[](index) ⇒ Object
43 44 45 |
# File 'lib/lutaml/model/schema_location.rb', line 43 def [](index) @schema_location[index] end |
#size ⇒ Object
47 48 49 |
# File 'lib/lutaml/model/schema_location.rb', line 47 def size @schema_location.size end |
#to_xml_attributes ⇒ Object
36 37 38 39 40 41 |
# File 'lib/lutaml/model/schema_location.rb', line 36 def to_xml_attributes { "xmlns:#{prefix}" => namespace, "#{prefix}:schemaLocation" => schema_location.map(&:to_xml_attribute).join(" "), } end |