Class: Armg::WkbDeserializer
- Inherits:
-
Object
- Object
- Armg::WkbDeserializer
- Defined in:
- lib/armg/wkb_deserializer.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ support_ewkb: true }.freeze
Instance Method Summary collapse
- #deserialize(mysql_geometry) ⇒ Object
-
#initialize(factory: nil, **options) ⇒ WkbDeserializer
constructor
A new instance of WkbDeserializer.
Constructor Details
#initialize(factory: nil, **options) ⇒ WkbDeserializer
Returns a new instance of WkbDeserializer.
9 10 11 12 |
# File 'lib/armg/wkb_deserializer.rb', line 9 def initialize(factory: nil, **) = DEFAULT_OPTIONS.merge() @wkb_parser = RGeo::WKRep::WKBParser.new(factory, ) end |
Instance Method Details
#deserialize(mysql_geometry) ⇒ Object
14 15 16 17 |
# File 'lib/armg/wkb_deserializer.rb', line 14 def deserialize(mysql_geometry) wkb = Armg::Utils.mysql_geometry_to_wkb(mysql_geometry) @wkb_parser.parse(wkb) end |