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



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

def administrative_scope
  as = @nodeset.search('.//xmlns:administrativeScope', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').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



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

def extents
  extents = @nodeset.search('.//xmlns:extents', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').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



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

def geographic_scope
  gs = @nodeset.search('.//xmlns:geographicScope', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').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



7
8
9
10
11
# File 'lib/placemaker/document.rb', line 7

def place_details
  @nodeset.search('.//xmlns:placeDetails', 'xmlns' => 'http://wherein.yahooapis.com/v1/schema').map do |p|
    Placemaker::PlaceDetails.new(p)
  end
end