Class: Qype::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/qype/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_secret, base_uri = nil) ⇒ Client

Returns a new instance of Client.



7
8
9
10
# File 'lib/qype/client.rb', line 7

def initialize(api_key, api_secret, base_uri = nil)
  Client.default_options[:oauth] = { :key => api_key, :secret => api_secret, :method => 'HMAC-SHA1' }
  Client.base_uri(base_uri) if base_uri
end

Instance Method Details

#get(path, options = {}) ⇒ Object



12
13
14
# File 'lib/qype/client.rb', line 12

def get(path, options = {})
  self.class.get(path, options)
end

#get_place(place_id) ⇒ Object



24
25
26
# File 'lib/qype/client.rb', line 24

def get_place(place_id)
  Place.get(self, place_id)
end

#nearby_places(latitude, longitude, options = {}) ⇒ Object



20
21
22
# File 'lib/qype/client.rb', line 20

def nearby_places(latitude, longitude, options = {})
  Place.nearby(self, latitude, longitude, options)
end

#search_places(search_term, location_name) ⇒ Object



16
17
18
# File 'lib/qype/client.rb', line 16

def search_places(search_term, location_name)
  Place.search(self, search_term, location_name)
end