Class: Ruqqus::Submission Abstract
- Defined in:
- lib/ruqqus/types/submission.rb
Overview
Instance Attribute Summary collapse
-
#author_name ⇒ String?
readonly
The name of the creator of the item, or
nil
if deleted account. -
#body ⇒ String
readonly
The text body of the item.
-
#body_html ⇒ String
readonly
The text body of the item in HTML format.
-
#downvotes ⇒ Integer
readonly
The number of downvotes this item has received.
-
#fullname ⇒ String
readonly
The full ID of this item.
-
#guild_name ⇒ String
readonly
The name of the guild this item is contained within.
-
#last_edit ⇒ Time
readonly
The time of the last edit.
-
#last_edit_utc ⇒ Integer
readonly
The time of the last edit in seconds since the Unix epoch, or
0
if never edited. -
#score ⇒ Integer
readonly
A score calculated by adding upvotes and subtracting downvotes.
-
#title ⇒ String
readonly
The name/title of this item.
-
#upvotes ⇒ Integer
readonly
The number of upvotes this item has received.
Attributes inherited from ItemBase
#created, #created_utc, #id, #permalink
Instance Method Summary collapse
-
#archived? ⇒ Boolean
true
if item has been archived, otherwisefalse
. -
#deleted? ⇒ Boolean
true
if item has been deleted, otherwisefalse
. -
#edited? ⇒ Boolean
true
if post has been edited, otherwisefalse
. -
#nsfl? ⇒ Boolean
true
if item is adult content and flagged as NSFL, otheriwsefalse
. -
#nsfw? ⇒ Boolean
true
if item is adult content and flagged as NSFW, otherwisefalse
. -
#offensive? ⇒ Boolean
true
if item has been classified has offensive, otherwisefalse
. -
#to_s ⇒ String
The string representation of the object.
Methods inherited from ItemBase
Instance Attribute Details
#author_name ⇒ String? (readonly)
Returns the name of the creator of the item, or nil
if deleted account.
|
# File 'lib/ruqqus/types/submission.rb', line 13
|
#body ⇒ String (readonly)
Returns the text body of the item.
|
# File 'lib/ruqqus/types/submission.rb', line 17
|
#body_html ⇒ String (readonly)
Returns the text body of the item in HTML format.
|
# File 'lib/ruqqus/types/submission.rb', line 21
|
#downvotes ⇒ Integer (readonly)
Returns the number of downvotes this item has received.
|
# File 'lib/ruqqus/types/submission.rb', line 37
|
#fullname ⇒ String (readonly)
Returns the full ID of this item.
|
# File 'lib/ruqqus/types/submission.rb', line 45
|
#guild_name ⇒ String (readonly)
Returns the name of the guild this item is contained within.
|
# File 'lib/ruqqus/types/submission.rb', line 49
|
#last_edit ⇒ Time (readonly)
Returns the time of the last edit.
|
# File 'lib/ruqqus/types/submission.rb', line 29
|
#last_edit_utc ⇒ Integer (readonly)
Returns the time of the last edit in seconds since the Unix epoch, or 0
if never edited.
|
# File 'lib/ruqqus/types/submission.rb', line 25
|
#score ⇒ Integer (readonly)
Returns a score calculated by adding upvotes and subtracting downvotes.
|
# File 'lib/ruqqus/types/submission.rb', line 41
|
#title ⇒ String (readonly)
Returns the name/title of this item.
|
# File 'lib/ruqqus/types/submission.rb', line 9
|
#upvotes ⇒ Integer (readonly)
Returns the number of upvotes this item has received.
|
# File 'lib/ruqqus/types/submission.rb', line 33
|
Instance Method Details
#archived? ⇒ Boolean
Returns true
if item has been archived, otherwise false
.
73 74 75 |
# File 'lib/ruqqus/types/submission.rb', line 73 def archived? !!@data[:is_archived] end |
#deleted? ⇒ Boolean
Returns true
if item has been deleted, otherwise false
.
79 80 81 |
# File 'lib/ruqqus/types/submission.rb', line 79 def deleted? !!@data[:is_deleted] end |
#edited? ⇒ Boolean
Returns true
if post has been edited, otherwise false
.
55 56 57 |
# File 'lib/ruqqus/types/submission.rb', line 55 def edited? @data[:edited_utc] != 0 end |
#nsfl? ⇒ Boolean
Returns true
if item is adult content and flagged as NSFL, otheriwse false
.
67 68 69 |
# File 'lib/ruqqus/types/submission.rb', line 67 def nsfl? !!@data[:is_nsfl] end |
#nsfw? ⇒ Boolean
Returns true
if item is adult content and flagged as NSFW, otherwise false
.
61 62 63 |
# File 'lib/ruqqus/types/submission.rb', line 61 def nsfw? !!@data[:is_nsfw] end |
#offensive? ⇒ Boolean
Returns true
if item has been classified has offensive, otherwise false
.
85 86 87 |
# File 'lib/ruqqus/types/submission.rb', line 85 def offensive? !!@data[:is_offensive] end |
#to_s ⇒ String
Returns the string representation of the object.
91 92 93 |
# File 'lib/ruqqus/types/submission.rb', line 91 def to_s @data[:id] end |