Class: Placemaker::Document
- Inherits:
-
Object
- Object
- Placemaker::Document
- Includes:
- XmlHelper
- Defined in:
- lib/placemaker/document.rb
Instance Method Summary collapse
-
#administrative_scope ⇒ Object
Returns a Placemaker::Location object that is a container for the smallest administrative place that best describes the document.
-
#extents ⇒ Object
Returns a Placemaker::Extents object that is a container for the the map extents covering the places mentioned in the document.
-
#geographic_scope ⇒ Object
Returns a Placemaker::Location object that is a container for the smallest place that best describes the document.
-
#place_details ⇒ Object
Returns a Placemaker::Location object that is a container for one named place mentioned in the document.
Methods included from XmlHelper
Instance Method Details
#administrative_scope ⇒ Object
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 |
#extents ⇒ Object
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_scope ⇒ Object
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_details ⇒ Object
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 |