vimeo_ruby 0.3.0 → 0.4.2
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/CHANGELOG.md +16 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/vimeo_ruby/user/uploaded_video_collection.rb +4 -0
- data/lib/vimeo_ruby/user.rb +15 -4
- data/lib/vimeo_ruby/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: 6e322bad016985f2258e442017837049fd62007364cc6338ca4e705f7b573b5d
|
4
|
+
data.tar.gz: 12fd20df10e0df161bb757931079f9d53aeb8468795a7ffac3f20b7ea4ed2228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b0eb5766fa016c12d1992e3a67e063559ac3b48c53e053d04b8897ecf3f75f79ba693200b29301b032e32e145baeec2f8e15548ab099e63ac5b288818967ef
|
7
|
+
data.tar.gz: 5f9507375cac59c5c9ccb88f4f40cef547fadee3e680319652585a62a247df7966e54c1750380d7a92b9c7215ea3ca53948c97428ef645707c8fbfccaf2c35c0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.2] - 2022-12-29
|
4
|
+
|
5
|
+
- Refactor `VimeoRuby::User#uploaded_videos` method
|
6
|
+
|
7
|
+
## [0.4.1] - 2022-12-29
|
8
|
+
|
9
|
+
- Fix erroneous minor version release (yanked 0.4.0)
|
10
|
+
|
11
|
+
## [0.4.0] - 2022-12-29
|
12
|
+
|
13
|
+
- Save unnecessary call to get a users uploaded video collection if we already have it and no additional query params are passed in to `VimeoRuby::User#uploaded_videos`.
|
14
|
+
|
15
|
+
## [0.3.0] - 2022-12-29
|
16
|
+
|
17
|
+
- Add shorthand methods on `VimeoRuby` module for `get_user(<vimeo_id>)` and `get_video(<vimeo_id>)` to retrieve the appropriate data.
|
18
|
+
|
3
19
|
## [0.2.0] - 2022-12-28
|
4
20
|
|
5
21
|
- Initial User and Video classes, with beginning interface to retrieve records from the Vimeo API. Adds a connection class used to hold a collection of a users uploaded videos (VimeoRuby::User::UploadedVideoCollection) accessible by calling `VimeoRuby::User#uploaded_videos`.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/vimeo_ruby/user.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module VimeoRuby
|
2
2
|
class User < Base
|
3
|
-
attr_reader :vimeo_id, :available_for_hire, :bio, :can_work_remotely, :location, :name, :profile_link, :additional_info
|
3
|
+
attr_reader :vimeo_id, :video_collection, :available_for_hire, :bio, :can_work_remotely, :location, :name, :profile_link, :additional_info
|
4
4
|
|
5
5
|
def initialize(attrs: {})
|
6
6
|
@vimeo_id = extract_vimeo_id_from_uri(attrs.delete("uri"))
|
@@ -10,6 +10,7 @@ module VimeoRuby
|
|
10
10
|
@location = attrs.delete("location")
|
11
11
|
@name = attrs.delete("name")
|
12
12
|
@profile_link = attrs.delete("link")
|
13
|
+
@video_collection = nil
|
13
14
|
@additional_info = OpenStruct.new(attrs)
|
14
15
|
end
|
15
16
|
|
@@ -23,9 +24,11 @@ module VimeoRuby
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def uploaded_videos(query_params: {})
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
if @video_collection.nil? || !query_params.empty?
|
28
|
+
@video_collection = retrieve_video_collection(query_params)
|
29
|
+
else
|
30
|
+
@video_collection
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
34
|
def available_for_hire?
|
@@ -35,5 +38,13 @@ module VimeoRuby
|
|
35
38
|
def can_work_remotely?
|
36
39
|
@can_work_remotely
|
37
40
|
end
|
41
|
+
|
42
|
+
private
|
43
|
+
|
44
|
+
def retrieve_video_collection(query_params)
|
45
|
+
uploaded_videos_response = self.class.get("#{base_uri}/users/#{vimeo_id}/videos", query_params: query_params)
|
46
|
+
uploaded_videos = uploaded_videos_response["data"]
|
47
|
+
UploadedVideoCollection.new(uploaded_videos)
|
48
|
+
end
|
38
49
|
end
|
39
50
|
end
|
data/lib/vimeo_ruby/version.rb
CHANGED