Class: AtlasClient::PoiFinder

Inherits:
Finder
  • Object
show all
Defined in:
lib/atlas_client/poi_finder.rb

Class Method Summary collapse

Methods inherited from Finder

get_json

Class Method Details

.find_by_id(id) ⇒ Object



11
12
13
# File 'lib/atlas_client/poi_finder.rb', line 11

def self.find_by_id id
  query("where[id]=#{id}").first
end

.find_by_place_id(place_id) ⇒ Object



7
8
9
# File 'lib/atlas_client/poi_finder.rb', line 7

def self.find_by_place_id place_id
  query "where[place]=#{place_id}"
end

.query(query_string) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/atlas_client/poi_finder.rb', line 15

def self.query query_string
  json = get_json @pois_url+query_string+"&limit=999999"
  pois = []
  json['pois'].collect do |poi_json|
    POI.new(poi_json)
  end
end