Class: RedditKit::Subreddit

Inherits:
Thing show all
Includes:
Creatable
Defined in:
lib/redditkit/subreddit.rb

Overview

A class representing a subreddit.

Instance Attribute Summary collapse

Attributes inherited from Thing

#id, #kind

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods included from Creatable

#created_at

Methods inherited from Thing

#==, #full_name

Methods inherited from Base

#[], attr_reader, #initialize

Constructor Details

This class inherits a constructor from RedditKit::Base

Instance Attribute Details

#accounts_activeObject (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_minsObject (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

#descriptionObject (readonly)

The description of the subreddit, in Markdown.



17
18
19
# File 'lib/redditkit/subreddit.rb', line 17

def description
  @description
end

#description_htmlObject (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_nameObject (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_imgObject (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_sizeObject (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_titleObject (readonly)

The subreddit’s header title.



32
33
34
# File 'lib/redditkit/subreddit.rb', line 32

def header_title
  @header_title
end

#over18Object (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_descriptionObject (readonly)

The subreddit’s public description.



38
39
40
# File 'lib/redditkit/subreddit.rb', line 38

def public_description
  @public_description
end

#public_trafficObject (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_commentsObject (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

Returns the value of attribute spam_links.



43
44
45
# File 'lib/redditkit/subreddit.rb', line 43

def spam_links
  @spam_links
end

#spam_selfpostObject (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_typeObject (readonly)

Returns the value of attribute submission_type.



45
46
47
# File 'lib/redditkit/subreddit.rb', line 45

def submission_type
  @submission_type
end

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_textObject (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_htmlObject (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_labelObject (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_typeObject (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

#subscribersObject (readonly)

The number of subscribers to the subreddit.



55
56
57
# File 'lib/redditkit/subreddit.rb', line 55

def subscribers
  @subscribers
end

#titleObject (readonly)

The subreddit’s title.



58
59
60
# File 'lib/redditkit/subreddit.rb', line 58

def title
  @title
end

#urlObject (readonly)

The URL to the subreddit.



61
62
63
# File 'lib/redditkit/subreddit.rb', line 61

def url
  @url
end

#user_is_bannedObject (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_contributorObject (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_moderatorObject (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_subscriberObject (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

#uriObject



85
86
87
# File 'lib/redditkit/subreddit.rb', line 85

def uri
  @uri ||= URI.join "http://www.reddit.com/r/", name
end