dian_ping 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43bf72178382fe6bba05e7371f551364eab84b22
4
- data.tar.gz: 9fdef73d735f05fbe3b6aa22b85438b755c53fe5
3
+ metadata.gz: 0de84cbe48c75de94684aed126e2c0bc8fce340c
4
+ data.tar.gz: 818f67388b497c813ca3866bb188aa36eb63825c
5
5
  SHA512:
6
- metadata.gz: 8ada054ed5b597694ca363eb52310945cc82c6e03dd1100a18f369a26ad88dfa8ff998cb5739942b9c8950724ac043cce6399cd33eb30f744ad377514e276e0f
7
- data.tar.gz: 68790114291e9604abd25f5b030f2213a6526f6152917d6bb259b6ca0370a707c87d955c76cfa037f55a3f2ce1225aa0b583be0a528a555cb056a4bfe5c8a6b2
6
+ metadata.gz: 51cc320f84cd60d9ab9c447ec70f0b3206c94f42a20f2aa544015b1446901ef82845fb32cf30c61036610a1a3cceb11be97ac4381d85cccfbddf6ba63382e0ab
7
+ data.tar.gz: 5a0033953077b9a3a4f200efd286840b9b3bdb461608c8404f7e956d70f540428b4f396bd19a82decd04d1dcb78f823b68171ecd866203d5bb7f6fc2045dd998
data/lib/dian_ping.rb CHANGED
@@ -6,7 +6,7 @@ require 'dianping/parameter'
6
6
  class DianPing
7
7
  include HTTParty
8
8
 
9
- VERSION = '0.0.3'
9
+ VERSION = '0.0.4'
10
10
 
11
11
  attr_accessor :key, :secret
12
12
 
@@ -32,6 +32,16 @@ class DianPing
32
32
  get '/v1/review/get_recent_reviews'
33
33
  end
34
34
 
35
+ def categories(city = nil)
36
+ add :city, city
37
+ get '/v1/metadata/get_categories_with_businesses'
38
+ end
39
+
40
+ def regions(city = nil)
41
+ add :city, city
42
+ get '/v1/metadata/get_regions_with_businesses'
43
+ end
44
+
35
45
  end
36
46
  end
37
47
 
@@ -10,7 +10,7 @@ class DianPing
10
10
  if config_file.file?
11
11
  begin
12
12
  options = YAML.load_file(config_file)[Rails.env]
13
- ::DP = DianPing.new(key: options['appkey'], secret: options['appSecret'])
13
+ ::DP = DianPing.new(key: options['appkey'], secret: options['appSecret']) unless defined?(::DP)
14
14
  rescue Exception => e
15
15
  puts "There is a configuration error with the current dian_ping.yml"
16
16
  puts e.message
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dian_ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - zires
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-15 00:00:00.000000000 Z
11
+ date: 2013-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty