onedrive_for_business 1.0.2 → 1.0.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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9788b5383ebc75a511de438073d88b4c3dd07646
|
4
|
+
data.tar.gz: de34bfbe42d26aafe791f4e626b1d5600850179f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff945e5ef45e3bb55b0ccce408b7f603fac2df5b631ddd4876810ed0bc835f2fff11ffdc31d22d2890911734a07c93b5db3f5c0bed61e3c0abf637b5c141aa3
|
7
|
+
data.tar.gz: a5e30459d6da9b5a8d1b0c9454ee5c8252c947bdfefc7b0525d41f2dd9e68331f5e95c60d16ac05dd78fa6579f9ed87e67996af653088e6373091d13424b0e8d
|
@@ -1,11 +1,19 @@
|
|
1
1
|
require_relative './item'
|
2
|
+
require_relative './util'
|
2
3
|
|
3
4
|
module OneDriveForBusiness
|
4
5
|
class File < Item
|
6
|
+
include Util
|
7
|
+
|
5
8
|
def initialize(drive, fields)
|
6
9
|
@content_url = fields['content_url']
|
7
10
|
@image = ImageFacet.new(fields['image']) if fields['image']
|
8
11
|
super
|
9
12
|
end
|
13
|
+
|
14
|
+
def download!
|
15
|
+
url = "#{drive.url}/Files/#{id}/content"
|
16
|
+
http(url).get(url, 'authorization' => "Bearer #{drive.access_token}").body
|
17
|
+
end
|
10
18
|
end
|
11
19
|
end
|
@@ -58,7 +58,11 @@ module OneDriveForBusiness
|
|
58
58
|
url = "#{drive.url}/Files/#{id}/children"
|
59
59
|
resp = http(url).get(
|
60
60
|
url, 'authorization' => "Bearer #{drive.access_token}")
|
61
|
-
|
61
|
+
JSON.parse(resp.body)['value'].select do |o|
|
62
|
+
o['type'] == 'File'
|
63
|
+
end.map do |o|
|
64
|
+
File.new(drive, o)
|
65
|
+
end
|
62
66
|
end
|
63
67
|
end
|
64
68
|
end
|