reddit_api 0.3.7 → 0.3.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 292bf6104bdf9caef9b511487dae467ca7f80027
4
- data.tar.gz: 9c6ad75a21b6212aa344838ef75ebaf6d27f35f8
3
+ metadata.gz: e8a8ce32e4cd7da32db8b127ad3ad5dc97568204
4
+ data.tar.gz: f0a74409a59f2540772610bbab2df900be97196a
5
5
  SHA512:
6
- metadata.gz: 960734c9c8f49d1eadd4925b9b06f25ab723b0a315542060001fab360926f25d963fda43530d0254dec562ae5e25c9fdb60e0a19ef5804e433b42a45311d8602
7
- data.tar.gz: 63daf4190d8391b3f197684a87206c3d3d5bb5da783a48426ee197a6ef8f9dfb4d7718860f0bd558322abf750b1bb70dd14146a514cab691025c2d6320da0177
6
+ metadata.gz: 51e621d39e7cd023c8f1fea8a5a6286880746a7edc6551589688d99af7fb9d601f123bc7d0a8cdc3135b54ab798e393076b17233e98f43fd24e88b5fb3bb8560
7
+ data.tar.gz: b15d5695afcd6e7d14f8a00fe3f339fafa8f9e83ccde946319418618413837f9d96f1a28e1c04ee2fe855546aa933013d119d49ea81d3fc5929ed7e0d44704f9
@@ -1,4 +1,3 @@
1
-
2
1
  module RedditApi
3
2
  class Query
4
3
 
@@ -1,4 +1,3 @@
1
-
2
1
  module RedditApi
3
2
  class Users
4
3
 
@@ -7,7 +6,7 @@ module RedditApi
7
6
  attr_reader :misses
8
7
 
9
8
  def initialize(args = {})
10
- @post_api = RedditApi::Posts.new
9
+ @post_api = args.fetch(:posts, RedditApi::Posts.new)
11
10
  @user_factory = RedditApi::User
12
11
  @misses = args.fetch(:misses, 0)
13
12
  @max_misses = args.fetch(:max_miss, DEFAULT_MAX_MISSES)
@@ -21,7 +20,7 @@ module RedditApi
21
20
  collect_users(posts, count, users)
22
21
  update_misses(users.length)
23
22
  end
24
- reset_misses
23
+ reset_collection_metrics
25
24
  users.values
26
25
  end
27
26
 
@@ -63,6 +62,7 @@ module RedditApi
63
62
  end
64
63
 
65
64
  def aggregate_users(new_users, collected_users)
65
+ self.last_count = collected_users.length
66
66
  new_users.each do |user|
67
67
  collected_users[user.username] = user
68
68
  end
@@ -74,8 +74,9 @@ module RedditApi
74
74
  end
75
75
  end
76
76
 
77
- def reset_misses
77
+ def reset_collection_metrics
78
78
  self.misses = 0
79
+ self.last_count = 0
79
80
  end
80
81
 
81
82
  end
@@ -1,3 +1,3 @@
1
1
  module RedditApi
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Fuentes