twttr 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/twttr/client/endpoint/v2/users/follows.rb +14 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fe60301d1d17eb4a2904de32bbd649364bb864e13cbe9c56c5151d987c34ec4
|
4
|
+
data.tar.gz: c7c28b855390fe720ce157d49e8d6f7525ae14ad797bc1a1fbdda77ed4efabfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa537df933312dea3e75e86dcf6828b7d8ca2cc81138ec46f7b3e867b81dcaa01c542c601306f26f8c8d68590762071bb80d04dd88ef155c5df0798abf568e3d
|
7
|
+
data.tar.gz: fe96a4b38af080331a25a6be5a31d9e5cfc98d0b95b54faabfd1b45dce89bdb1e16e37635eace45bb7a8ef9c63983f295024ebe1fd82c4e7ad15a14c9b823795
|
@@ -19,25 +19,25 @@ module Twttr
|
|
19
19
|
# @yield [Array<Twttr::Model::User>] Users followed by page.
|
20
20
|
# @return [Array<Twttr::Model::User>] Users followed.
|
21
21
|
# @return [String,NilClass] Pagination token.
|
22
|
-
def following(user_id, max_results: nil, pagination_token: nil) # rubocop:disable Metrics/MethodLength
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
}.compact)
|
22
|
+
def following(user_id, max_results: nil, pagination_token: nil, &block) # rubocop:disable Metrics/MethodLength
|
23
|
+
response = get(FOLLOWING_PATH, params: { user_id: user_id },
|
24
|
+
query_params: {
|
25
|
+
'user.fields': config.user_fields,
|
26
|
+
max_results: max_results,
|
27
|
+
pagination_token: pagination_token
|
28
|
+
}.compact)
|
30
29
|
|
31
|
-
|
30
|
+
return [], nil if response['meta']['result_count'].zero?
|
32
31
|
|
33
|
-
|
32
|
+
users = response['data'].map { |v| Model::User.new(v, self) }
|
34
33
|
|
35
|
-
|
34
|
+
pagination_token = response['meta']['pagination_token']
|
36
35
|
|
37
|
-
|
36
|
+
return users, pagination_token unless block_given?
|
38
37
|
|
39
|
-
|
40
|
-
|
38
|
+
yield users, pagination_token
|
39
|
+
|
40
|
+
following(user_id, pagination_token, &block) unless pagination_token.nil?
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twttr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Decurnex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth
|