microslop_one_drive 1.0.0 → 1.1.0
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 +4 -4
- data/README.md +9 -5
- data/lib/microslop_one_drive/drive.rb +5 -2
- data/lib/microslop_one_drive/version.rb +1 -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: 906a333b5d1d209772825b3788a154ad92bba28c22cf2d0d2a593bdcdaf21221
|
|
4
|
+
data.tar.gz: 711effa7f493b9eb2c21a2d7bc8397e2cbec592ad102d52f4b0195f9ac388881
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d07ee564bb649d80ac86741132be2babdf535c55e97daae586df0da803870242c3fb9f9228648b30cfd2fa695787cc36adc6ac2ef9cf5b7655237b815dccb02
|
|
7
|
+
data.tar.gz: bcdac643fc87905c507c7cc9b537a0af4779ab84b5e48aa77928e3ba39eb8bb37459b64141f00a7c95569e1e6621e5317174d1b9c8d84a0edd43c86d990eb28b
|
data/README.md
CHANGED
|
@@ -8,8 +8,10 @@ Graph explorer (API sandbox): <https://developer.microsoft.com/en-us/graph/graph
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
+
Add this to your Gemfile:
|
|
12
|
+
|
|
11
13
|
```rb
|
|
12
|
-
|
|
14
|
+
gem "microslop_one_drive"
|
|
13
15
|
```
|
|
14
16
|
|
|
15
17
|
## Usage
|
|
@@ -42,10 +44,12 @@ drive_list.drives # => [MicroslopOneDrive::Drive, ...]
|
|
|
42
44
|
|
|
43
45
|
drive = drive_list.drives.first
|
|
44
46
|
drive.class # => MicroslopOneDrive::Drive
|
|
45
|
-
drive.
|
|
47
|
+
drive.identifier # => "0f0**********42"
|
|
46
48
|
drive.name # => "OneDrive"
|
|
47
49
|
drive.url # => "https://my.microsoftpersonalcontent.com/..."
|
|
48
50
|
drive.drive_type # => "personal"
|
|
51
|
+
drive.created_at
|
|
52
|
+
drive.updated_at
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
### Get a single Drive
|
|
@@ -54,7 +58,7 @@ drive.drive_type # => "personal"
|
|
|
54
58
|
drive = client.drive(drive_id: "0f097********a42")
|
|
55
59
|
|
|
56
60
|
drive.class # => MicroslopOneDrive::Drive
|
|
57
|
-
drive.
|
|
61
|
+
drive.identifier # => "0f097********a42"
|
|
58
62
|
drive.name # => "OneDrive"
|
|
59
63
|
drive.url # => "https://my.microsoftpersonalcontent.com/personal/..."
|
|
60
64
|
drive.drive_type # => "personal"
|
|
@@ -154,7 +158,7 @@ gem signin
|
|
|
154
158
|
|
|
155
159
|
# Then build:
|
|
156
160
|
gem build microslop_drive.gemspec
|
|
161
|
+
# You will get a *.gem file like microslop_one_drive-X.Y.Z.gem
|
|
157
162
|
|
|
158
|
-
|
|
159
|
-
gem push microslop_one_drive-0.1.0.gem
|
|
163
|
+
gem push microslop_one_drive-X.Y.Z.gem
|
|
160
164
|
```
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
module MicroslopOneDrive
|
|
2
2
|
class Drive
|
|
3
|
-
attr_reader :
|
|
3
|
+
attr_reader :identifier, :name, :url, :drive_type, :created_at, :updated_at
|
|
4
4
|
|
|
5
5
|
def initialize(drive_hash)
|
|
6
6
|
@drive_hash = drive_hash
|
|
7
7
|
|
|
8
|
-
@
|
|
8
|
+
@identifier = drive_hash.fetch("id", nil)
|
|
9
9
|
@name = drive_hash.fetch("name", nil)
|
|
10
10
|
@url = drive_hash.fetch("webUrl", nil)
|
|
11
11
|
@drive_type = drive_hash.fetch("driveType", nil)
|
|
12
|
+
|
|
13
|
+
@created_at = Utils.safe_parse_time(drive_hash.fetch("createdDateTime", nil))
|
|
14
|
+
@updated_at = Utils.safe_parse_time(drive_hash.fetch("lastModifiedDateTime", nil))
|
|
12
15
|
end
|
|
13
16
|
end
|
|
14
17
|
end
|