lib/armg/wkb_deserializer.rb in armg-0.7.1 vs lib/armg/wkb_deserializer.rb in armg-0.7.2

- old
+ new

@@ -1,15 +1,19 @@ -class Armg::WkbDeserializer - DEFAULT_OPTIONS = { - support_ewkb: true, - } +# frozen_string_literal: true - def initialize(factory: nil, **options) - options = DEFAULT_OPTIONS.merge(options) - @wkb_parser = RGeo::WKRep::WKBParser.new(factory, options) - end +module Armg + class WkbDeserializer + DEFAULT_OPTIONS = { + support_ewkb: true + }.freeze - def deserialize(mysql_geometry) - wkb = Armg::Utils.mysql_geometry_to_wkb(mysql_geometry) - @wkb_parser.parse(wkb) + def initialize(factory: nil, **options) + options = DEFAULT_OPTIONS.merge(options) + @wkb_parser = RGeo::WKRep::WKBParser.new(factory, options) + end + + def deserialize(mysql_geometry) + wkb = Armg::Utils.mysql_geometry_to_wkb(mysql_geometry) + @wkb_parser.parse(wkb) + end end end