yuntongxun_api 0.1.0 → 0.1.1

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: a7e8859ef4c24e7fa089d55b4f548fe75803878c
4
- data.tar.gz: d27bccf99d5f5717f8014eaa0ba9482769bcce01
3
+ metadata.gz: 56a713763cb47814bcd4654fac567863acb0a496
4
+ data.tar.gz: 20a045a1b4f8ed5d0730a2b168403374ef82f1d9
5
5
  SHA512:
6
- metadata.gz: 3251269785a67ab38019572526636d242a0a870d9b4abe5bc76547e2721f5a7fb6af91405fede94bf3c090d627fda7ba34e5663528b6d92f95f37f9a84702346
7
- data.tar.gz: d32e21a10967e17f8287f27eacf59d0fcaca04a967e7256824c6c30d66891e5e096d6030da82a944751f921c7003b2db1c6a8387bc2161e7d1693c6c7e5aa605
6
+ metadata.gz: 48e3ef55a30bc2c7a88db173103114fe4ed44e3393c3c99ab780837bd2a0b653ce45a5fb12346e0adf443390b670f7e66afe882f7667e7858616313cf21de30b
7
+ data.tar.gz: 98ac6b321c815d99e794c54cfeccacca440366c8cf0d5df176b1c75b1525a870f0395e12df7de0f6eb06ce24f95773dce546d63eda0d634e2703d640eb18ad1d
data/README.md CHANGED
@@ -34,6 +34,7 @@ YunTongXun.setup do |config|
34
34
  config.server = 'https://app.cloopen.com:8883'
35
35
  config.account_sid = ''
36
36
  config.auth_token = ''
37
+ config.app_id = ''
37
38
  config.version = '2013-12-26'
38
39
  end
39
40
  ```
@@ -43,7 +44,6 @@ end
43
44
  ```ruby
44
45
  params = {
45
46
  to: '',
46
- appId: '',
47
47
  templateId: '',
48
48
  datas: '',
49
49
  }
@@ -56,7 +56,6 @@ YunTongXun::Sms.send(params)
56
56
  ```ruby
57
57
  params = {
58
58
  to: '',
59
- appId: '',
60
59
  verifyCode: '',
61
60
  }
62
61
 
@@ -78,7 +77,6 @@ YunTongXun::Voice.double_call(params)
78
77
 
79
78
  ```ruby
80
79
  params = {
81
- appId: '',
82
80
  callSid: '',
83
81
  type: '',
84
82
  }
@@ -86,11 +84,10 @@ params = {
86
84
  YunTongXun::Voice.cancel_call(params)
87
85
  ```
88
86
 
89
- ### 取消回拨
87
+ ### 外呼通知
90
88
 
91
89
  ```ruby
92
90
  params = {
93
- appId: '',
94
91
  to: '',
95
92
  }
96
93
 
@@ -29,7 +29,15 @@ module YunTongXun
29
29
  def auth_token=(auth_token)
30
30
  @auth_token = auth_token
31
31
  end
32
+
33
+ def app_id
34
+ @app_id ||= 'your_app_id'
35
+ end
32
36
 
37
+ def app_id=(app_id)
38
+ @app_id = app_id
39
+ end
40
+
33
41
  def version
34
42
  @version ||= 'version'
35
43
  end
@@ -9,6 +9,8 @@ module YunTongXun
9
9
  # 短信发送
10
10
  def send(params)
11
11
  @method = 'SMS/TemplateSMS'
12
+ params[:appId] = params[:appId] || YunTongXun.config.app_id
13
+
12
14
  response = get_response(params)
13
15
  end
14
16
 
@@ -1,3 +1,3 @@
1
1
  module YunTongXun
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -8,6 +8,7 @@ module YunTongXun
8
8
  def voice_verify(params)
9
9
  @accounts = 'Accounts'
10
10
  @method = 'Calls/VoiceVerify'
11
+ params[:appId] = params[:appId] || YunTongXun.config.app_id
11
12
 
12
13
  response = get_response(params)
13
14
  end
@@ -24,6 +25,7 @@ module YunTongXun
24
25
  def cancel_call(params)
25
26
  @accounts = 'Accounts'
26
27
  @method = 'Calls/CallCancel'
28
+ params[:appId] = params[:appId] || YunTongXun.config.app_id
27
29
 
28
30
  response = get_response(params)
29
31
  end
@@ -32,6 +34,7 @@ module YunTongXun
32
34
  def landing_call(params)
33
35
  @accounts = 'Accounts'
34
36
  @method = 'Calls/LandingCalls'
37
+ params[:appId] = params[:appId] || YunTongXun.config.app_id
35
38
 
36
39
  response = get_response(params)
37
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yuntongxun_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - skji
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-05 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler