Maybe something along the lines of this?
```ruby
def self.embedDefinitions(layers_filename)
self.definitions(layers_filename)
.select { |entry| entry["canEmbed"] }
.each_with_object({}) do |entry, obj|
obj[entry["layerId"]] = {
layer: entry["leafletOsmId"],
darkLayer: entry["leafletOsmDarkId"],
apikey: entry["apikey"]
}.compact
end
end
```
But I'm no ruby expert
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5352#issuecomment-2649047261
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5352/c2649047...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev