Class: Shale::Schema::XMLGenerator::Import Private
- Inherits:
-
Object
- Object
- Shale::Schema::XMLGenerator::Import
- Defined in:
- lib/shale/schema/xml_generator/import.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class representing XML Schema <import> element
Instance Attribute Summary collapse
-
#namespace ⇒ String
readonly
private
Return namespace.
Instance Method Summary collapse
-
#as_xml(doc) ⇒ Shale::Adapter::<XML adapter>::Node
private
Append element to the XML document.
-
#initialize(namespace, location) ⇒ Import
constructor
private
Initialize Import object.
Constructor Details
#initialize(namespace, location) ⇒ Import
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize Import object
23 24 25 26 |
# File 'lib/shale/schema/xml_generator/import.rb', line 23 def initialize(namespace, location) @namespace = namespace @location = location end |
Instance Attribute Details
#namespace ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return namespace
15 16 17 |
# File 'lib/shale/schema/xml_generator/import.rb', line 15 def namespace @namespace end |
Instance Method Details
#as_xml(doc) ⇒ Shale::Adapter::<XML adapter>::Node
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Append element to the XML document
35 36 37 38 39 40 41 42 |
# File 'lib/shale/schema/xml_generator/import.rb', line 35 def as_xml(doc) import = doc.create_element('xs:import') doc.add_attribute(import, 'namespace', @namespace) if @namespace doc.add_attribute(import, 'schemaLocation', @location) if @location import end |