Class: Shale::Schema::XMLGenerator::Import Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

Parameters:

  • namespace (String, nil)
  • location (String, nil)


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

#namespaceString (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

Returns:

  • (String)


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

Parameters:

Returns:



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