Class: Redd::Object::Subreddit

Inherits:
Thing show all
Includes:
Thing::Messageable
Defined in:
lib/redd/object/subreddit.rb

Overview

Note:

This model can sure benefit from some lazy-loading…

A comment made on links.

Instance Attribute Summary collapse

Attributes inherited from Thing

#id, #kind

Attributes inherited from Base

#attributes, #client

Instance Method Summary collapse

Methods included from Thing::Messageable

#send_message

Methods inherited from Thing

#==, #fullname

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_activeObject (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_minsObject (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

#descriptionObject (readonly)

Returns the value of attribute description.



15
16
17
# File 'lib/redd/object/subreddit.rb', line 15

def description
  @description
end

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

#over18Object (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_trafficObject (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_typeObject (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

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

#subscribersObject (readonly)

Returns the value of attribute subscribers.



35
36
37
# File 'lib/redd/object/subreddit.rb', line 35

def subscribers
  @subscribers
end

#titleObject (readonly)

Returns the value of attribute title.



13
14
15
# File 'lib/redd/object/subreddit.rb', line 13

def title
  @title
end

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

#createdObject



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

#urlObject



49
50
51
# File 'lib/redd/object/subreddit.rb', line 49

def url
  "http://reddit.com" + @attributes[:url]
end