vimeo_ruby 0.3.0 → 0.4.1

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
  SHA256:
3
- metadata.gz: 1ed0fda96d5d2a68abd3abc83ad39b0687ed9346db340ff49e990d949657977a
4
- data.tar.gz: 5b1cc75bf6d4955c859ab443ebb167dcd96bb9cd63c1cd7505206180aa1ab0aa
3
+ metadata.gz: 7ddc19e27ceb164c54d03fcc8a551873a3c69eb783969cafc95ce644a8f9dfdb
4
+ data.tar.gz: 407f36cb900c6434cc06190abaf196c5ca1cf5b86a3254da7e49c9da2408c79d
5
5
  SHA512:
6
- metadata.gz: 50aa3fb2068c01fcd2ce01d3cf09a33b56a08688f1ef7f8a118f5f2b99679576a65510849f398993fafbd7056954f8ad9f9400ec6c139971909370f787fa139c
7
- data.tar.gz: 2354449f341d3e996e6488f65aa52e97425ed6bfa2003d011566050ae8f8096fe87b7b448ef7f8d6167e6eb1d0ac4451853d180f1608772b8936844681d5985f
6
+ metadata.gz: ae1f15845f9ab6d34ca9deb873df7632ea549df34e571983b49db4740722a0cff2dfd7c4ac437954d0e8413cbed8a47782d8eee969c0d964aa29fbfb905b2c0d
7
+ data.tar.gz: ca9d147f701953220ca9add1f8a7d46d31212aefa6da269de66c0ea230884d5a7882b45d1643222090af9d051ad3b02c73821c202c0c10823a39c3f68c62b7f8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.0] - 2022-12-29
4
+
5
+ - 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`.
6
+
7
+ ## [0.3.0] - 2022-12-29
8
+
9
+ - Add shorthand methods on `VimeoRuby` module for `get_user(<vimeo_id>)` and `get_video(<vimeo_id>)` to retrieve the appropriate data.
10
+
3
11
  ## [0.2.0] - 2022-12-28
4
12
 
5
13
  - 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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vimeo_ruby (0.3.0)
4
+ vimeo_ruby (0.4.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # VimeoRuby 0.2.0
1
+ # VimeoRuby 0.3.0
2
2
 
3
3
  Welcome to VimeoRuby!
4
4
 
@@ -8,6 +8,10 @@ module VimeoRuby
8
8
  Video.new(attrs: video_data)
9
9
  end
10
10
  end
11
+
12
+ def empty?
13
+ videos.empty?
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -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,13 @@ module VimeoRuby
23
24
  end
24
25
 
25
26
  def uploaded_videos(query_params: {})
26
- uploaded_videos_response = self.class.get("#{base_uri}/users/#{vimeo_id}/videos", query_params: query_params)
27
- uploaded_videos = uploaded_videos_response["data"]
28
- UploadedVideoCollection.new(uploaded_videos)
27
+ if @video_collection.nil? || !query_params.empty?
28
+ uploaded_videos_response = self.class.get("#{base_uri}/users/#{vimeo_id}/videos", query_params: query_params)
29
+ uploaded_videos = uploaded_videos_response["data"]
30
+ @video_collection = UploadedVideoCollection.new(uploaded_videos)
31
+ else
32
+ @video_collection
33
+ end
29
34
  end
30
35
 
31
36
  def available_for_hire?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VimeoRuby
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimeo_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Collin Jilbert