ucloud_storage 0.0.7 → 0.0.8
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.
@@ -6,7 +6,7 @@ module UcloudStorage
|
|
6
6
|
class NotAuthorized < StandardError; end
|
7
7
|
|
8
8
|
class UcloudStorage
|
9
|
-
attr_accessor :user, :pass, :storage_url, :auth_token, :
|
9
|
+
attr_accessor :user, :pass, :storage_url, :auth_token, :response_code
|
10
10
|
|
11
11
|
def authorize
|
12
12
|
response = HTTParty.get("https://api.ucloudbiz.olleh.com/storage/v1/auth/",
|
@@ -33,8 +33,8 @@ module UcloudStorage
|
|
33
33
|
"Content-Type" => contenttype,
|
34
34
|
"Content-Length" => file.size.to_s },
|
35
35
|
body: file.read)
|
36
|
-
self.
|
37
|
-
case self.
|
36
|
+
self.response_code = response.code
|
37
|
+
case self.response_code
|
38
38
|
when 201 then
|
39
39
|
true
|
40
40
|
else
|