Class: Redd::Object::Comment
- Defined in:
- lib/redd/object/comment.rb
Overview
A comment made on links.
Instance Attribute Summary collapse
-
#approved_by ⇒ Object
readonly
Returns the value of attribute approved_by.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#author_flair_css_class ⇒ Object
readonly
Returns the value of attribute author_flair_css_class.
-
#author_flair_text ⇒ Object
readonly
Returns the value of attribute author_flair_text.
-
#banned_by ⇒ Object
readonly
Returns the value of attribute banned_by.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#body_html ⇒ Object
readonly
Returns the value of attribute body_html.
-
#controversiality ⇒ Object
readonly
Returns the value of attribute controversiality.
-
#distinguished ⇒ Object
readonly
Returns the value of attribute distinguished.
-
#downs ⇒ Object
readonly
Returns the value of attribute downs.
-
#edited ⇒ Object
readonly
Returns the value of attribute edited.
-
#gilded ⇒ Object
readonly
Returns the value of attribute gilded.
-
#likes ⇒ Object
readonly
Returns the value of attribute likes.
-
#link_id ⇒ Object
readonly
Returns the value of attribute link_id.
-
#num_reports ⇒ Object
(also: #reports_count)
readonly
Returns the value of attribute num_reports.
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#saved ⇒ Object
readonly
Returns the value of attribute saved.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#score_hidden ⇒ Object
readonly
Returns the value of attribute score_hidden.
-
#ups ⇒ Object
readonly
Returns the value of attribute ups.
Attributes inherited from Thing
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Thing::Voteable
Methods included from Thing::Reportable
Methods included from Thing::Moderatable
#approve, #distinguish, #ignore_reports, #remove, #undistinguish, #unignore_reports
Methods included from Thing::Inboxable
#mark_as_read, #mark_as_unread, #reply
Methods included from Thing::Editable
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
#approved_by ⇒ Object (readonly)
Returns the value of attribute approved_by.
32 33 34 |
# File 'lib/redd/object/comment.rb', line 32 def approved_by @approved_by end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
19 20 21 |
# File 'lib/redd/object/comment.rb', line 19 def @author end |
#author_flair_css_class ⇒ Object (readonly)
Returns the value of attribute author_flair_css_class.
42 43 44 |
# File 'lib/redd/object/comment.rb', line 42 def @author_flair_css_class end |
#author_flair_text ⇒ Object (readonly)
Returns the value of attribute author_flair_text.
41 42 43 |
# File 'lib/redd/object/comment.rb', line 41 def @author_flair_text end |
#banned_by ⇒ Object (readonly)
Returns the value of attribute banned_by.
31 32 33 |
# File 'lib/redd/object/comment.rb', line 31 def banned_by @banned_by end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
39 40 41 |
# File 'lib/redd/object/comment.rb', line 39 def body @body end |
#body_html ⇒ Object (readonly)
Returns the value of attribute body_html.
40 41 42 |
# File 'lib/redd/object/comment.rb', line 40 def body_html @body_html end |
#controversiality ⇒ Object (readonly)
Returns the value of attribute controversiality.
29 30 31 |
# File 'lib/redd/object/comment.rb', line 29 def controversiality @controversiality end |
#distinguished ⇒ Object (readonly)
Returns the value of attribute distinguished.
34 35 36 |
# File 'lib/redd/object/comment.rb', line 34 def distinguished @distinguished end |
#downs ⇒ Object (readonly)
Returns the value of attribute downs.
26 27 28 |
# File 'lib/redd/object/comment.rb', line 26 def downs @downs end |
#edited ⇒ Object (readonly)
Returns the value of attribute edited.
21 22 23 |
# File 'lib/redd/object/comment.rb', line 21 def edited @edited end |
#gilded ⇒ Object (readonly)
Returns the value of attribute gilded.
23 24 25 |
# File 'lib/redd/object/comment.rb', line 23 def gilded @gilded end |
#likes ⇒ Object (readonly)
Returns the value of attribute likes.
28 29 30 |
# File 'lib/redd/object/comment.rb', line 28 def likes @likes end |
#link_id ⇒ Object (readonly)
Returns the value of attribute link_id.
38 39 40 |
# File 'lib/redd/object/comment.rb', line 38 def link_id @link_id end |
#num_reports ⇒ Object (readonly) Also known as: reports_count
Returns the value of attribute num_reports.
35 36 37 |
# File 'lib/redd/object/comment.rb', line 35 def num_reports @num_reports end |
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
37 38 39 |
# File 'lib/redd/object/comment.rb', line 37 def parent_id @parent_id end |
#saved ⇒ Object (readonly)
Returns the value of attribute saved.
22 23 24 |
# File 'lib/redd/object/comment.rb', line 22 def saved @saved end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
27 28 29 |
# File 'lib/redd/object/comment.rb', line 27 def score @score end |
#score_hidden ⇒ Object (readonly)
Returns the value of attribute score_hidden.
33 34 35 |
# File 'lib/redd/object/comment.rb', line 33 def score_hidden @score_hidden end |
#ups ⇒ Object (readonly)
Returns the value of attribute ups.
25 26 27 |
# File 'lib/redd/object/comment.rb', line 25 def ups @ups end |
Instance Method Details
#created ⇒ Object
54 55 56 |
# File 'lib/redd/object/comment.rb', line 54 def created @created ||= Time.at(@attributes[:created_utc]) end |
#gilded? ⇒ Boolean
62 63 64 |
# File 'lib/redd/object/comment.rb', line 62 def gilded? gilded > 0 end |
#replies ⇒ Object
46 47 48 |
# File 'lib/redd/object/comment.rb', line 46 def replies @replies ||= client.get_replies(self) end |
#root? ⇒ Boolean
58 59 60 |
# File 'lib/redd/object/comment.rb', line 58 def root? !parent_id || parent_id == link_id end |
#subreddit ⇒ Object
50 51 52 |
# File 'lib/redd/object/comment.rb', line 50 def subreddit @subreddit ||= client.subreddit(@attributes[:subreddit]) end |