class RGeoServer::Namespace

A namespace is a uniquely identifiable grouping of feature types. A namespaces is identified by a prefix and a uri.

Constants

OBJ_ATTRIBUTES
OBJ_DEFAULT_ATTRIBUTES

Public Class Methods

member_xpath() click to toggle source
# File lib/rgeoserver/namespace.rb, line 23
def self.member_xpath
  "//#{resource_name}"
end
new(catalog, options) click to toggle source

@param [RGeoServer::Catalog] catalog @param [Hash] options

Calls superclass method
# File lib/rgeoserver/namespace.rb, line 43
def initialize catalog, options
  super(catalog)
  _run_initialize_callbacks do
    @name = options[:name].strip
    @uri = options[:uri] if options[:uri]
  end        
  @route = route
end
resource_name() click to toggle source
# File lib/rgeoserver/namespace.rb, line 15
def self.resource_name
  @@resource_name
end
root_xpath() click to toggle source
# File lib/rgeoserver/namespace.rb, line 19
def self.root_xpath
  "//#{@@route}/#{@@resource_name}"
end

Public Instance Methods

message() click to toggle source
# File lib/rgeoserver/namespace.rb, line 31
def message
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.namespace { 
      xml.prefix @name 
      xml.uri @uri
    }
  end
  return builder.doc.to_xml 
end
profile_xml_to_hash(profile_xml) click to toggle source
# File lib/rgeoserver/namespace.rb, line 52
def profile_xml_to_hash profile_xml
  doc = profile_xml_to_ng profile_xml 
  h = {
    'name' => doc.at_xpath('//namespace/prefix/text()').to_s,
    'uri' => doc.at_xpath('//namespace/uri/text()').to_s
  }.freeze
  h  
end
route() click to toggle source
# File lib/rgeoserver/namespace.rb, line 27
def route
  @@route  
end