Class: AtlasClient::PlaceFinder

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

Class Method Summary collapse

Methods inherited from Finder

get_json

Class Method Details

.find_by_id(id) ⇒ Object



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

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

.query(query_string) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/atlas_client/place_finder.rb', line 11

def self.query query_string
  json = get_json @places_url+query_string+"&limit=999999"
  places = []
  json['places'].collect do |place_json|
    Place.new(place_json)
  end
end