aliyun-rails 0.1.6 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aliyun/rails/connector/rpc_client.rb +13 -7
- data/lib/aliyun/rails/dysms.rb +5 -3
- data/lib/aliyun/rails/dyvms.rb +6 -4
- data/lib/aliyun/rails/version.rb +1 -1
- data/lib/aliyun-rails.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1142c76ee10a9c043b69a7bd38af493f5bea16be5ebf3c178992d8ad0a6ab77b
|
4
|
+
data.tar.gz: '061853f0ccc9663b9d5fce56d2714124a93bf6d797c0ff8de420091e46c6d5a3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 991bd34fca04f0271c2e4b5687bee642f64e33aaefda3a39e544f10ede9f27a2849ffe1a1a7974150f26aef4b6d5d7b525e207726cd9b29e922c9ecbf9f9e9eb
|
7
|
+
data.tar.gz: 8451cbb7129b84360376ddf2ab6edbffeb81b4ff7aed03b9d382294e22e51145d4793bc20d32c74b8b650fdc58087f668afba35b658bb13b0379bcddaffcdf19
|
@@ -10,21 +10,27 @@ module Aliyun
|
|
10
10
|
module Rails
|
11
11
|
module Connector
|
12
12
|
class RPCClient
|
13
|
-
|
14
|
-
|
13
|
+
# 类方法接受初始化变量
|
14
|
+
class << self
|
15
|
+
attr_accessor :access_key_id, :access_key_secret
|
15
16
|
|
16
|
-
|
17
|
-
|
17
|
+
def configure
|
18
|
+
yield self
|
19
|
+
end
|
18
20
|
end
|
19
21
|
|
22
|
+
attr_accessor :endpoint, :api_version, :access_key_id, :access_key_secret,
|
23
|
+
:security_token, :codes, :opts, :verbose
|
24
|
+
|
20
25
|
# 对象初始化属性
|
21
|
-
def initialize(
|
26
|
+
def initialize(verbose = false)
|
27
|
+
config = configure
|
22
28
|
validate config
|
23
29
|
|
24
30
|
self.endpoint = config[:endpoint]
|
25
31
|
self.api_version = config[:api_version]
|
26
|
-
self.access_key_id = config[:access_key_id]
|
27
|
-
self.access_key_secret = config[:access_key_secret]
|
32
|
+
self.access_key_id = config[:access_key_id] || RPCClient.access_key_id
|
33
|
+
self.access_key_secret = config[:access_key_secret] || RPCClient.access_key_secret
|
28
34
|
self.security_token = config[:security_token]
|
29
35
|
self.opts = config[:opts] || {}
|
30
36
|
self.verbose = verbose.instance_of?(TrueClass) && verbose
|
data/lib/aliyun/rails/dysms.rb
CHANGED
@@ -3,11 +3,13 @@
|
|
3
3
|
module Aliyun
|
4
4
|
module Rails
|
5
5
|
class Dysms < Aliyun::Rails::Connector::RPCClient
|
6
|
+
attr_accessor :endpoint, :api_version
|
7
|
+
|
6
8
|
# 本产品(Dysmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
|
7
9
|
# 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
|
8
|
-
def initialize(
|
9
|
-
|
10
|
-
|
10
|
+
def initialize(verbose = nil)
|
11
|
+
self.endpoint = "http://dysmsapi.aliyuncs.com"
|
12
|
+
self.api_version = "2017-05-25"
|
11
13
|
|
12
14
|
super
|
13
15
|
end
|
data/lib/aliyun/rails/dyvms.rb
CHANGED
@@ -2,12 +2,14 @@
|
|
2
2
|
|
3
3
|
module Aliyun
|
4
4
|
module Rails
|
5
|
-
class
|
5
|
+
class Dyvms < Aliyun::Rails::Connector::RPCClient
|
6
|
+
attr_accessor :endpoint, :api_version
|
7
|
+
|
6
8
|
# 本产品(Dyvmsapi/2017-05-25)的OpenAPI采用RPC签名风格,签名细节参见签名机制说明。
|
7
9
|
# 我们已经为开发者封装了常见编程语言的SDK,开发者可通过下载SDK直接调用本产品OpenAPI而无需关心技术细节。
|
8
|
-
def initialize(
|
9
|
-
|
10
|
-
|
10
|
+
def initialize(verbose = nil)
|
11
|
+
self.endpoint = "http://dyvmsapi.aliyuncs.com"
|
12
|
+
self.api_version = "2017-05-25"
|
11
13
|
|
12
14
|
super
|
13
15
|
end
|
data/lib/aliyun/rails/version.rb
CHANGED
data/lib/aliyun-rails.rb
CHANGED