reddit_api 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reddit_api/subreddit.rb +11 -2
- data/lib/reddit_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da41df33022a93de1a956a9e8c33d4e96c41929f
|
4
|
+
data.tar.gz: 3d61f6a55b5302335ce351886ae5b8da070ba3d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6c7b5c1ff718cb1fcc36476da913ebb4485f8ce9b35de23cc4bbc5956c1ac3d5e207fc94fc3e93a8e0ee8d6e41d1460fc679d238f9432e84f15b679767ca3be
|
7
|
+
data.tar.gz: 2bd57ae29adc0b16a0383238c0fb30865aa83aff708c11dee561a3a29f0de9a98f22ae0501ce392ab0e11f8beb37c245a134d7586493365d997329c93c3ec4d5
|
data/lib/reddit_api/subreddit.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
|
2
2
|
module RedditApi
|
3
3
|
class Subreddit
|
4
|
-
attr_reader :reddit_id, :name, :url, :description, :subscriber_count
|
4
|
+
attr_reader :reddit_id, :name, :url, :description, :subscriber_count,
|
5
|
+
:icon, :category, :active_users, :nsfw
|
5
6
|
|
6
7
|
def initialize(args = {})
|
7
8
|
@reddit_id = args.fetch("id", nil)
|
@@ -9,6 +10,10 @@ module RedditApi
|
|
9
10
|
@url = args.fetch("url", nil)
|
10
11
|
@description = args.fetch("public_description", nil)
|
11
12
|
@subscriber_count = args.fetch("subscribers", nil)
|
13
|
+
@icon = args.fetch("header_img", nil)
|
14
|
+
@category = args.fetch("advertiser_category", nil)
|
15
|
+
@active_users = args.fetch("accounts_active", nil)
|
16
|
+
@nsfw = args.fetch("over18", nil)
|
12
17
|
end
|
13
18
|
|
14
19
|
def to_h
|
@@ -17,7 +22,11 @@ module RedditApi
|
|
17
22
|
name: name,
|
18
23
|
url: url,
|
19
24
|
description: description,
|
20
|
-
subscriber_count: subscriber_count
|
25
|
+
subscriber_count: subscriber_count,
|
26
|
+
icon: icon,
|
27
|
+
category: category,
|
28
|
+
active_users: active_users,
|
29
|
+
nsfw: nsfw
|
21
30
|
}
|
22
31
|
end
|
23
32
|
|
data/lib/reddit_api/version.rb
CHANGED