Class: BaiduApis::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/baidu_apis/helper.rb

Class Method Summary collapse

Class Method Details

.iplookupObject



29
30
31
32
33
34
35
# File 'lib/baidu_apis/helper.rb', line 29

def iplookup
  {
      method: "get",
      url: "apistore/iplookupservice/iplookup",
      param_key: "ip"
  }
end

.meinvObject



37
38
39
40
41
42
43
# File 'lib/baidu_apis/helper.rb', line 37

def meinv
  {
      method: "get",
      url: "txapi/mvtp/meinv",
      param_key: "num"
  }
end

.phoneObject



20
21
22
23
24
25
26
# File 'lib/baidu_apis/helper.rb', line 20

def phone
  {
      method: "get",
      url: "apistore/mobilenumber/mobilenumber",
      param_key: "phone"
  }
end

.register_helper(name, config) ⇒ Object



45
46
47
48
49
# File 'lib/baidu_apis/helper.rb', line 45

def register_helper(name, config)
  send :define_singleton_method, name do
    config
  end
end

.stockObject



4
5
6
7
8
9
# File 'lib/baidu_apis/helper.rb', line 4

def stock
  {
      method: "get",
      url: "apistore/stockservice/stock"
  }
end

.weatherObject



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

def weather
  {
      method: "get",
      url: "apistore/weatherservice/cityname",
      param_key: "cityname"
  }
end