Class: RedditKit::Multireddit
- Includes:
- Creatable
- Defined in:
- lib/redditkit/multireddit.rb
Overview
A class representing a multireddit.
Instance Attribute Summary collapse
-
#can_edit ⇒ Object
(also: #editable?)
readonly
Returns the value of attribute can_edit.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Attributes inherited from Base
Instance Method Summary collapse
-
#subreddits ⇒ Array<String>
An array of subreddit display names.
-
#username ⇒ String
The username of the multireddit’s owner.
Methods included from Creatable
Methods inherited from Base
Constructor Details
This class inherits a constructor from RedditKit::Base
Instance Attribute Details
#can_edit ⇒ Object (readonly) Also known as: editable?
Returns the value of attribute can_edit.
11 12 13 |
# File 'lib/redditkit/multireddit.rb', line 11 def can_edit @can_edit end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/redditkit/multireddit.rb', line 10 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/redditkit/multireddit.rb', line 13 def path @path end |
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
12 13 14 |
# File 'lib/redditkit/multireddit.rb', line 12 def visibility @visibility end |
Instance Method Details
#subreddits ⇒ Array<String>
An array of subreddit display names.
20 21 22 |
# File 'lib/redditkit/multireddit.rb', line 20 def subreddits @subreddits ||= @attributes[:subreddits].map { |subreddit| subreddit[:name] } end |
#username ⇒ String
The username of the multireddit’s owner.
27 28 29 |
# File 'lib/redditkit/multireddit.rb', line 27 def username @username ||= path[/\/user\/(.*)\/m\//, 1] end |