dianping-api 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8739ca18c627d07503c20dc80087fb335e4c67165490c301db372ec9a506168d
4
- data.tar.gz: 97e6298fe7d94c9f78cd6ed25d9f8cfa39b88cf5054e9325bca77b40cdebb273
3
+ metadata.gz: 71f0df3df1c538b4da40ad6778af54a2ccc8f58a97de536fa820ce711fe6ee2d
4
+ data.tar.gz: 2ea42eed408aca26191d5a87267908b223ac8ceed534320e04cb351ead5d17a7
5
5
  SHA512:
6
- metadata.gz: 1ed02e94b7c8ff8e7d6a039ffe7466aeb15fb53dd459fc0dd045795cacddd32e6f77ff376c7e6cad39383e0a37ab7ca40fa24eff3f6f6ed342bbf1d8af7d3af6
7
- data.tar.gz: 158b17cc9141e222e2c3e1d820747ddf678075035227eba2cae13e56f22605d717f7f6ebcdd12fdb5aa83e49cfee05a0f829f9f1f6f711a1ffed7f37418d5b44
6
+ metadata.gz: 2efe5dde5e3a84e6952a710fc461f5f6c3b7dcb35041047e6d179e694c6894ef4f85df5d00036725ea63d36e78ef049c447cf164fc06cd7c542fe5f3981ffbba
7
+ data.tar.gz: 001b13240d3878018f409fc15331b0b4e80498dbda5511df43c06437921de051024a8613630a8ed515430bf761698e3c1d89e92fb3900707db9e9678ce1c881c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dianping-api (0.1.1)
4
+ dianping-api (0.1.2)
5
5
  faraday (~> 1.0)
6
6
  multi_json (~> 1.0)
7
7
 
@@ -6,12 +6,13 @@ module Dianping
6
6
 
7
7
  include Modules::Tuangou
8
8
 
9
- attr_reader :app_key, :site, :token, :redirect_url
9
+ attr_reader :app_key, :site, :token
10
+ attr_accessor :redirect_url
10
11
 
11
12
  def initialize(app_key, secret, **options)
12
13
  @app_key = app_key
13
14
  @secret = secret
14
- @site = 'https://openapi.dianping.com'
15
+ @site = options[:site] || 'https://openapi.dianping.com'
15
16
  @redirect_url = options[:redirect_url]
16
17
  @token = Token.new(self)
17
18
  end
@@ -75,6 +76,10 @@ module Dianping
75
76
  json(res.body)
76
77
  end
77
78
 
79
+ def scope_shops
80
+ get('/router/oauth/session/scope', bid: token.bid)
81
+ end
82
+
78
83
  def json(text)
79
84
  MultiJson.load(text || '{}', symbolize_keys: true)
80
85
  end
@@ -14,6 +14,10 @@ module Dianping
14
14
 
15
15
  post '/router/tuangou/receipt/consume', params
16
16
  end
17
+
18
+ def shop_deals(shop_deals)
19
+ get('/tuangou/deal/queryshopdeal', open_shop_uuid: shop_deals)
20
+ end
17
21
  end
18
22
  end
19
23
  end
@@ -49,6 +49,10 @@ module Dianping
49
49
  access_hash[:expires_in]
50
50
  end
51
51
 
52
+ def bid
53
+ access_hash[:bid]
54
+ end
55
+
52
56
  def updated_at
53
57
  Time.parse(access_hash[:updated_at])
54
58
  end
@@ -1,5 +1,5 @@
1
1
  module Dianping
2
2
  module Api
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dianping-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2020-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday