Class: RedditKit::Subreddit
- Includes:
- Creatable
- Defined in:
- lib/redditkit/subreddit.rb
Overview
A class representing a subreddit.
Instance Attribute Summary collapse
-
#accounts_active ⇒ Object
readonly
The number of users currently active in the subreddit.
-
#comment_score_hide_mins ⇒ Object
readonly
The number of minutes comment scores are hidden for.
-
#description ⇒ Object
readonly
The description of the subreddit, in Markdown.
-
#description_html ⇒ Object
readonly
The description of the subreddit, as HTML.
-
#display_name ⇒ Object
(also: #name)
readonly
The subreddit’s display name.
-
#header_img ⇒ Object
readonly
The URL to the subreddit’s header image, if it has one.
-
#header_size ⇒ Object
readonly
The size of the subreddit’s header image, if it has one.
-
#header_title ⇒ Object
readonly
The subreddit’s header title.
-
#over18 ⇒ Object
(also: #nsfw?)
readonly
Whether the subreddit has been marked as having content directed at people over 18 years old.
-
#public_description ⇒ Object
readonly
The subreddit’s public description.
-
#public_traffic ⇒ Object
readonly
Whether the subreddit’s traffic page is publicly visible.
-
#spam_comments ⇒ Object
(also: #comment_spam_filter_strength)
readonly
Returns the value of attribute spam_comments.
-
#spam_links ⇒ Object
(also: #link_spam_filter_strength)
readonly
Returns the value of attribute spam_links.
-
#spam_selfpost ⇒ Object
(also: #self_post_spam_filter_strength)
readonly
Returns the value of attribute spam_selfpost.
-
#submission_type ⇒ Object
readonly
Returns the value of attribute submission_type.
-
#submit_link_label ⇒ Object
readonly
Returns the value of attribute submit_link_label.
-
#submit_text ⇒ Object
readonly
Returns the value of attribute submit_text.
-
#submit_text_html ⇒ Object
readonly
Returns the value of attribute submit_text_html.
-
#submit_text_label ⇒ Object
readonly
Returns the value of attribute submit_text_label.
-
#subreddit_type ⇒ Object
readonly
The subreddit’s type, either ‘public’ or ‘private’.
-
#subscribers ⇒ Object
readonly
The number of subscribers to the subreddit.
-
#title ⇒ Object
readonly
The subreddit’s title.
-
#url ⇒ Object
readonly
The URL to the subreddit.
-
#user_is_banned ⇒ Object
(also: #banned?)
readonly
Whether the current user is banned from the subreddit.
-
#user_is_contributor ⇒ Object
(also: #contributor?)
readonly
Whether the current user is a contributor to the subreddit.
-
#user_is_moderator ⇒ Object
(also: #moderator?)
readonly
Whether the current user is a moderator of the subreddit.
-
#user_is_subscriber ⇒ Object
(also: #subscriber?)
readonly
Whether the current user is a subscriber to the subreddit.
Attributes inherited from Thing
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Creatable
Methods inherited from Thing
Methods inherited from Base
Constructor Details
This class inherits a constructor from RedditKit::Base
Instance Attribute Details
#accounts_active ⇒ Object (readonly)
The number of users currently active in the subreddit.
11 12 13 |
# File 'lib/redditkit/subreddit.rb', line 11 def accounts_active @accounts_active end |
#comment_score_hide_mins ⇒ Object (readonly)
The number of minutes comment scores are hidden for.
14 15 16 |
# File 'lib/redditkit/subreddit.rb', line 14 def comment_score_hide_mins @comment_score_hide_mins end |
#description ⇒ Object (readonly)
The description of the subreddit, in Markdown.
17 18 19 |
# File 'lib/redditkit/subreddit.rb', line 17 def description @description end |
#description_html ⇒ Object (readonly)
The description of the subreddit, as HTML.
20 21 22 |
# File 'lib/redditkit/subreddit.rb', line 20 def description_html @description_html end |
#display_name ⇒ Object (readonly) Also known as: name
The subreddit’s display name. For reddit.com/r/programming, the display name is ‘programming’.
23 24 25 |
# File 'lib/redditkit/subreddit.rb', line 23 def display_name @display_name end |
#header_img ⇒ Object (readonly)
The URL to the subreddit’s header image, if it has one.
26 27 28 |
# File 'lib/redditkit/subreddit.rb', line 26 def header_img @header_img end |
#header_size ⇒ Object (readonly)
The size of the subreddit’s header image, if it has one.
29 30 31 |
# File 'lib/redditkit/subreddit.rb', line 29 def header_size @header_size end |
#header_title ⇒ Object (readonly)
The subreddit’s header title.
32 33 34 |
# File 'lib/redditkit/subreddit.rb', line 32 def header_title @header_title end |
#over18 ⇒ Object (readonly) Also known as: nsfw?
Whether the subreddit has been marked as having content directed at people over 18 years old.
35 36 37 |
# File 'lib/redditkit/subreddit.rb', line 35 def over18 @over18 end |
#public_description ⇒ Object (readonly)
The subreddit’s public description.
38 39 40 |
# File 'lib/redditkit/subreddit.rb', line 38 def public_description @public_description end |
#public_traffic ⇒ Object (readonly)
Whether the subreddit’s traffic page is publicly visible.
41 42 43 |
# File 'lib/redditkit/subreddit.rb', line 41 def public_traffic @public_traffic end |
#spam_comments ⇒ Object (readonly) Also known as: comment_spam_filter_strength
Returns the value of attribute spam_comments.
42 43 44 |
# File 'lib/redditkit/subreddit.rb', line 42 def spam_comments @spam_comments end |
#spam_links ⇒ Object (readonly) Also known as: link_spam_filter_strength
Returns the value of attribute spam_links.
43 44 45 |
# File 'lib/redditkit/subreddit.rb', line 43 def spam_links @spam_links end |
#spam_selfpost ⇒ Object (readonly) Also known as: self_post_spam_filter_strength
Returns the value of attribute spam_selfpost.
44 45 46 |
# File 'lib/redditkit/subreddit.rb', line 44 def spam_selfpost @spam_selfpost end |
#submission_type ⇒ Object (readonly)
Returns the value of attribute submission_type.
45 46 47 |
# File 'lib/redditkit/subreddit.rb', line 45 def submission_type @submission_type end |
#submit_link_label ⇒ Object (readonly)
Returns the value of attribute submit_link_label.
46 47 48 |
# File 'lib/redditkit/subreddit.rb', line 46 def submit_link_label @submit_link_label end |
#submit_text ⇒ Object (readonly)
Returns the value of attribute submit_text.
47 48 49 |
# File 'lib/redditkit/subreddit.rb', line 47 def submit_text @submit_text end |
#submit_text_html ⇒ Object (readonly)
Returns the value of attribute submit_text_html.
48 49 50 |
# File 'lib/redditkit/subreddit.rb', line 48 def submit_text_html @submit_text_html end |
#submit_text_label ⇒ Object (readonly)
Returns the value of attribute submit_text_label.
49 50 51 |
# File 'lib/redditkit/subreddit.rb', line 49 def submit_text_label @submit_text_label end |
#subreddit_type ⇒ Object (readonly)
The subreddit’s type, either ‘public’ or ‘private’.
52 53 54 |
# File 'lib/redditkit/subreddit.rb', line 52 def subreddit_type @subreddit_type end |
#subscribers ⇒ Object (readonly)
The number of subscribers to the subreddit.
55 56 57 |
# File 'lib/redditkit/subreddit.rb', line 55 def subscribers @subscribers end |
#title ⇒ Object (readonly)
The subreddit’s title.
58 59 60 |
# File 'lib/redditkit/subreddit.rb', line 58 def title @title end |
#url ⇒ Object (readonly)
The URL to the subreddit.
61 62 63 |
# File 'lib/redditkit/subreddit.rb', line 61 def url @url end |
#user_is_banned ⇒ Object (readonly) Also known as: banned?
Whether the current user is banned from the subreddit.
64 65 66 |
# File 'lib/redditkit/subreddit.rb', line 64 def user_is_banned @user_is_banned end |
#user_is_contributor ⇒ Object (readonly) Also known as: contributor?
Whether the current user is a contributor to the subreddit.
67 68 69 |
# File 'lib/redditkit/subreddit.rb', line 67 def user_is_contributor @user_is_contributor end |
#user_is_moderator ⇒ Object (readonly) Also known as: moderator?
Whether the current user is a moderator of the subreddit.
70 71 72 |
# File 'lib/redditkit/subreddit.rb', line 70 def user_is_moderator @user_is_moderator end |
#user_is_subscriber ⇒ Object (readonly) Also known as: subscriber?
Whether the current user is a subscriber to the subreddit.
73 74 75 |
# File 'lib/redditkit/subreddit.rb', line 73 def user_is_subscriber @user_is_subscriber end |
Instance Method Details
#uri ⇒ Object
85 86 87 |
# File 'lib/redditkit/subreddit.rb', line 85 def uri @uri ||= URI.join "http://www.reddit.com/r/", name end |