Class: Placemaker::Document

Inherits:
Object
  • Object
show all
Includes:
XmlHelper
Defined in:
lib/placemaker/document.rb

Instance Method Summary collapse

Methods included from XmlHelper

#initialize

Instance Method Details

#administrative_scopeObject

Returns a Placemaker::Location object that is a container for the smallest administrative place that best describes the document



20
21
22
23
# File 'lib/placemaker/document.rb', line 20

def administrative_scope
  as = @nodeset.search('.//xmlns:administrativeScope').first
  Placemaker::Location.new(as) unless as.nil?
end

#extentsObject

Returns a Placemaker::Extents object that is a container for the the map extents covering the places mentioned in the document



32
33
34
35
# File 'lib/placemaker/document.rb', line 32

def extents
  extents = @nodeset.search('.//xmlns:extents').first
  Placemaker::Extents.new(extents) unless extents.nil?
end

#geographic_scopeObject

Returns a Placemaker::Location object that is a container for the smallest place that best describes the document



26
27
28
29
# File 'lib/placemaker/document.rb', line 26

def geographic_scope
  gs = @nodeset.search('.//xmlns:geographicScope').first
  Placemaker::Location.new(gs) unless gs.nil?
end

#place_detailsObject

Returns a Placemaker::Location object that is a container for one named place mentioned in the document



13
14
15
16
17
# File 'lib/placemaker/document.rb', line 13

def place_details
  @nodeset.search('.//xmlns:placeDetails').map do |p|
    Placemaker::PlaceDetails.new(p)
  end
end

#reference_listObject



37
38
39
40
41
# File 'lib/placemaker/document.rb', line 37

def reference_list
  @nodeset.search('.//xmlns:referenceList[1]/xmlns:reference').map do |reference|
    Placemaker::Reference.new(reference)
  end
end