]> git.openstreetmap.org Git - rails.git/blobdiff - lib/osm_community_index.rb
Unnest OsmCommunityIndex
[rails.git] / lib / osm_community_index.rb
diff --git a/lib/osm_community_index.rb b/lib/osm_community_index.rb
new file mode 100644 (file)
index 0000000..f738e8a
--- /dev/null
@@ -0,0 +1,12 @@
+module OsmCommunityIndex
+  require "yaml"
+
+  def self.community_index
+    @community_index ||= community_index_from_json
+  end
+
+  def self.community_index_from_json
+    json_file = Rails.root.join("node_modules/osm-community-index/dist/resources.json")
+    JSON.parse(File.read(json_file))
+  end
+end