demarches-normaliennes/app/lib/api_adresse/point_adapter.rb

16 lines
266 B
Ruby
Raw Normal View History

2018-10-15 21:59:13 +02:00
class ApiAdresse::PointAdapter < ApiAdresse::Adapter
2018-10-15 17:26:06 +02:00
def initialize(address)
2018-10-15 21:59:13 +02:00
super(address, 1, nil)
2018-10-15 17:26:06 +02:00
end
2018-10-15 16:33:42 +02:00
def geocode
2018-10-15 21:59:13 +02:00
handle_result
2018-10-15 17:26:06 +02:00
end
2018-10-15 16:33:42 +02:00
2018-10-15 17:26:06 +02:00
private
2018-10-15 16:33:42 +02:00
2018-10-15 21:59:13 +02:00
def process_features
RGeo::GeoJSON.decode(features[0]['geometry'], json_parser: :json)
2018-10-15 16:33:42 +02:00
end
end