Sha256: ff53845c46ef15df8e0bad2122edd0cbb8c13a5e9017842c99160c912daa2a49

Contents?: true

Size: 566 Bytes

Versions: 18

Compression:

Stored size: 566 Bytes

Contents

module Frodo
  module Properties
    module Geography
      class Point < Base
        def type
          'Edm.GeographyPoint'
        end

        def coords_to_s
          value.join(' ')
        end

        def coords_from_s(str)
          str.split(' ').map(&:to_f)
        end

        def xml_value
          { pos: coords_to_s }
        end

        private

        def self.parse_xml(property_xml)
          property_xml.xpath('//pos').map do |el|
            el.content.split(' ').map(&:to_f)
          end.flatten
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
frodo-0.12.8 lib/frodo/properties/geography/point.rb
frodo-0.12.7 lib/frodo/properties/geography/point.rb
frodo-0.12.6 lib/frodo/properties/geography/point.rb
frodo-0.12.5 lib/frodo/properties/geography/point.rb
frodo-0.12.4 lib/frodo/properties/geography/point.rb
frodo-0.12.2 lib/frodo/properties/geography/point.rb
frodo-0.12.1 lib/frodo/properties/geography/point.rb
frodo-0.12.0 lib/frodo/properties/geography/point.rb
frodo-0.11.0 lib/frodo/properties/geography/point.rb
frodo-0.10.8 lib/frodo/properties/geography/point.rb
frodo-0.10.7 lib/frodo/properties/geography/point.rb
frodo-0.10.6 lib/frodo/properties/geography/point.rb
frodo-0.10.5 lib/frodo/properties/geography/point.rb
frodo-0.10.4 lib/frodo/properties/geography/point.rb
frodo-0.10.3 lib/frodo/properties/geography/point.rb
frodo-0.10.2 lib/frodo/properties/geography/point.rb
frodo-0.10.1 lib/frodo/properties/geography/point.rb
frodo-0.10.0 lib/frodo/properties/geography/point.rb