Class: Redd::Object::Subreddit
- Includes:
- Thing::Messageable
- Defined in:
- lib/redd/object/subreddit.rb
Overview
This model can sure benefit from some lazy-loading…
A comment made on links.
Instance Attribute Summary collapse
-
#accounts_active ⇒ Object
(also: #users_online)
readonly
Returns the value of attribute accounts_active.
-
#comment_score_hide_mins ⇒ Object
readonly
Returns the value of attribute comment_score_hide_mins.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#description_html ⇒ Object
readonly
Returns the value of attribute description_html.
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#header_img ⇒ Object
(also: #header_image)
readonly
Returns the value of attribute header_img.
-
#header_size ⇒ Object
readonly
Returns the value of attribute header_size.
-
#header_title ⇒ Object
readonly
Returns the value of attribute header_title.
-
#over18 ⇒ Object
(also: #nsfw?)
readonly
Returns the value of attribute over18.
-
#public_traffic ⇒ Object
readonly
Returns the value of attribute public_traffic.
-
#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
(also: #type)
readonly
Returns the value of attribute subreddit_type.
-
#subscribers ⇒ Object
readonly
Returns the value of attribute subscribers.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#user_is_banned ⇒ Object
readonly
Returns the value of attribute user_is_banned.
-
#user_is_contributor ⇒ Object
readonly
Returns the value of attribute user_is_contributor.
-
#user_is_moderator ⇒ Object
readonly
Returns the value of attribute user_is_moderator.
-
#user_is_subscriber ⇒ Object
readonly
Returns the value of attribute user_is_subscriber.
Attributes inherited from Thing
Attributes inherited from Base
Instance Method Summary collapse
- #created ⇒ Object
- #get_controversial(*args) ⇒ Object
- #get_hot(*args) ⇒ Object
- #get_new(*args) ⇒ Object
- #get_random(*args) ⇒ Object
- #get_top(*args) ⇒ Object
- #url ⇒ Object
Methods included from Thing::Messageable
Methods inherited from Thing
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, #initialize
Constructor Details
This class inherits a constructor from Redd::Base
Instance Attribute Details
#accounts_active ⇒ Object (readonly) Also known as: users_online
Returns the value of attribute accounts_active.
33 34 35 |
# File 'lib/redd/object/subreddit.rb', line 33 def accounts_active @accounts_active end |
#comment_score_hide_mins ⇒ Object (readonly)
Returns the value of attribute comment_score_hide_mins.
36 37 38 |
# File 'lib/redd/object/subreddit.rb', line 36 def comment_score_hide_mins @comment_score_hide_mins end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
15 16 17 |
# File 'lib/redd/object/subreddit.rb', line 15 def description @description end |
#description_html ⇒ Object (readonly)
Returns the value of attribute description_html.
16 17 18 |
# File 'lib/redd/object/subreddit.rb', line 16 def description_html @description_html end |
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
12 13 14 |
# File 'lib/redd/object/subreddit.rb', line 12 def display_name @display_name end |
#header_img ⇒ Object (readonly) Also known as: header_image
Returns the value of attribute header_img.
18 19 20 |
# File 'lib/redd/object/subreddit.rb', line 18 def header_img @header_img end |
#header_size ⇒ Object (readonly)
Returns the value of attribute header_size.
20 21 22 |
# File 'lib/redd/object/subreddit.rb', line 20 def header_size @header_size end |
#header_title ⇒ Object (readonly)
Returns the value of attribute header_title.
19 20 21 |
# File 'lib/redd/object/subreddit.rb', line 19 def header_title @header_title end |
#over18 ⇒ Object (readonly) Also known as: nsfw?
Returns the value of attribute over18.
32 33 34 |
# File 'lib/redd/object/subreddit.rb', line 32 def over18 @over18 end |
#public_traffic ⇒ Object (readonly)
Returns the value of attribute public_traffic.
34 35 36 |
# File 'lib/redd/object/subreddit.rb', line 34 def public_traffic @public_traffic end |
#submission_type ⇒ Object (readonly)
Returns the value of attribute submission_type.
38 39 40 |
# File 'lib/redd/object/subreddit.rb', line 38 def submission_type @submission_type end |
#submit_link_label ⇒ Object (readonly)
Returns the value of attribute submit_link_label.
29 30 31 |
# File 'lib/redd/object/subreddit.rb', line 29 def submit_link_label @submit_link_label end |
#submit_text ⇒ Object (readonly)
Returns the value of attribute submit_text.
27 28 29 |
# File 'lib/redd/object/subreddit.rb', line 27 def submit_text @submit_text end |
#submit_text_html ⇒ Object (readonly)
Returns the value of attribute submit_text_html.
28 29 30 |
# File 'lib/redd/object/subreddit.rb', line 28 def submit_text_html @submit_text_html end |
#submit_text_label ⇒ Object (readonly)
Returns the value of attribute submit_text_label.
30 31 32 |
# File 'lib/redd/object/subreddit.rb', line 30 def submit_text_label @submit_text_label end |
#subreddit_type ⇒ Object (readonly) Also known as: type
Returns the value of attribute subreddit_type.
37 38 39 |
# File 'lib/redd/object/subreddit.rb', line 37 def subreddit_type @subreddit_type end |
#subscribers ⇒ Object (readonly)
Returns the value of attribute subscribers.
35 36 37 |
# File 'lib/redd/object/subreddit.rb', line 35 def subscribers @subscribers end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
13 14 15 |
# File 'lib/redd/object/subreddit.rb', line 13 def title @title end |
#user_is_banned ⇒ Object (readonly)
Returns the value of attribute user_is_banned.
22 23 24 |
# File 'lib/redd/object/subreddit.rb', line 22 def user_is_banned @user_is_banned end |
#user_is_contributor ⇒ Object (readonly)
Returns the value of attribute user_is_contributor.
23 24 25 |
# File 'lib/redd/object/subreddit.rb', line 23 def user_is_contributor @user_is_contributor end |
#user_is_moderator ⇒ Object (readonly)
Returns the value of attribute user_is_moderator.
24 25 26 |
# File 'lib/redd/object/subreddit.rb', line 24 def user_is_moderator @user_is_moderator end |
#user_is_subscriber ⇒ Object (readonly)
Returns the value of attribute user_is_subscriber.
25 26 27 |
# File 'lib/redd/object/subreddit.rb', line 25 def user_is_subscriber @user_is_subscriber end |
Instance Method Details
#created ⇒ Object
45 46 47 |
# File 'lib/redd/object/subreddit.rb', line 45 def created @created ||= Time.at(@attributes[:created_utc]) end |
#get_controversial(*args) ⇒ Object
69 70 71 |
# File 'lib/redd/object/subreddit.rb', line 69 def get_controversial(*args) client.get_controversial(display_name, *args) end |
#get_hot(*args) ⇒ Object
53 54 55 |
# File 'lib/redd/object/subreddit.rb', line 53 def get_hot(*args) client.get_hot(display_name, *args) end |
#get_new(*args) ⇒ Object
57 58 59 |
# File 'lib/redd/object/subreddit.rb', line 57 def get_new(*args) client.get_new(display_name, *args) end |
#get_random(*args) ⇒ Object
61 62 63 |
# File 'lib/redd/object/subreddit.rb', line 61 def get_random(*args) client.get_random(display_name, *args) end |
#get_top(*args) ⇒ Object
65 66 67 |
# File 'lib/redd/object/subreddit.rb', line 65 def get_top(*args) client.get_top(display_name, *args) end |
#url ⇒ Object
49 50 51 |
# File 'lib/redd/object/subreddit.rb', line 49 def url "http://reddit.com" + @attributes[:url] end |