class OData4::Properties::Geography::LineString

Private Class Methods

parse_xml(property_xml) click to toggle source
# File lib/odata4/properties/geography/line_string.rb, line 25
def self.parse_xml(property_xml)
  property_xml.xpath('//pos').map do |el|
    el.content.split(' ').map(&:to_f)
  end
end

Public Instance Methods

coords_from_s(str) click to toggle source
# File lib/odata4/properties/geography/line_string.rb, line 13
def coords_from_s(str)
  str.split(',').map { |pos| pos.split(' ').map(&:to_f) }
end
coords_to_s() click to toggle source
# File lib/odata4/properties/geography/line_string.rb, line 9
def coords_to_s
  value.map { |pos| pos.join(' ') }.join(',')
end
type() click to toggle source
# File lib/odata4/properties/geography/line_string.rb, line 5
def type
  'Edm.GeographyLineString'
end
xml_value() click to toggle source
# File lib/odata4/properties/geography/line_string.rb, line 17
def xml_value
  value.map do |coords|
    { pos: coords.join(' ') }
  end
end