Class: BaiduApi::LbsCloud::V3::Geosearch

Inherits:
Object
  • Object
show all
Includes:
RequestBase
Defined in:
lib/baidu_api/lbs_cloud/v3/geosearch.rb

Instance Attribute Summary

Attributes included from RequestBase

#ak, #sk

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RequestBase

included, #initialize

Class Method Details

.instanceObject



9
10
11
# File 'lib/baidu_api/lbs_cloud/v3/geosearch.rb', line 9

def self.instance
  @instance || fail('Has to setup Geosearch before using')
end

.setup(params) ⇒ Object



3
4
5
6
7
# File 'lib/baidu_api/lbs_cloud/v3/geosearch.rb', line 3

def self.setup(params)
  ak = params.fetch(:ak) { fail ':ak is required.' }
  sk = params.fetch(:sk, nil)
  @instance = new(ak, sk)
end

Instance Method Details

#bound(data) ⇒ Object



25
26
27
# File 'lib/baidu_api/lbs_cloud/v3/geosearch.rb', line 25

def bound(data)
  request('bound', data)
end

#detail(uid, data) ⇒ Object



29
30
31
# File 'lib/baidu_api/lbs_cloud/v3/geosearch.rb', line 29

def detail(uid, data)
  request("detail/#{uid}", data)
end

#local(data) ⇒ Object



21
22
23
# File 'lib/baidu_api/lbs_cloud/v3/geosearch.rb', line 21

def local(data)
  request('local', data)
end

#nearby(data) ⇒ Object



17
18
19
# File 'lib/baidu_api/lbs_cloud/v3/geosearch.rb', line 17

def nearby(data)
  request('nearby', data)
end