]> git.openstreetmap.org Git - rails.git/blob - lib/osm_community_index.rb
Use map rather than foo = [] ... each ... foo.push(bar)
[rails.git] / lib / osm_community_index.rb
1 module OsmCommunityIndex
2   require "yaml"
3
4   def self.community_index
5     @community_index ||= community_index_from_json
6   end
7
8   def self.community_index_from_json
9     json_file = Rails.root.join("node_modules/osm-community-index/dist/resources.json")
10     JSON.parse(File.read(json_file))
11   end
12 end