Class: Datacite::Mapping::GeoLocationBoxNode
- Inherits:
-
XML::MappingExtensions::NodeBase
- Object
- XML::MappingExtensions::NodeBase
- Datacite::Mapping::GeoLocationBoxNode
- Defined in:
- lib/datacite/mapping/geo_location_box.rb
Overview
XML mapping node for <geoLocationBox/>
Instance Method Summary collapse
-
#to_value(xml_text)
Converts a whitespace-separated list of coordinates to a GeoLocationBox.
Instance Method Details
#to_value(xml_text)
Converts a whitespace-separated list of coordinates to a Datacite::Mapping::GeoLocationBox.
128 129 130 131 132 |
# File 'lib/datacite/mapping/geo_location_box.rb', line 128 def to_value(xml_text) stripped = xml_text.strip coords = stripped.split(/\s+/).map(&:to_f) GeoLocationBox.new(*coords) end |