module NeonRAW::Objects::Thing::Moderateable
Methods for moderators. @!attribute [r] mod_reports
@return [Array<String>, nil] Returns the mod reports or nil if there are none.
@!attribute [r] user_reports
@return [Array<String>, nil] Returns the user reports or nil if there are none.
Public Instance Methods
Approve a comment or submission. @!method approve!
# File lib/NeonRAW/objects/thing/moderateable.rb, line 14 def approve! params = { id: name } @client.request_data('/api/approve', :post, params) refresh! end
Distinguish a submission/comment. @!method distinguish!(type, params = { sticky: nil }) @param type [String] The type of distinguish you want to do [yes, no,
admin, special].
@param params [Hash<Symbol>] Optional parameters. @option params :sticky [Boolean] Whether or not you want the post
stickied (top level mod comments only!)
@!group Moderators
# File lib/NeonRAW/objects/thing/moderateable.rb, line 41 def distinguish!(type, params = { sticky: nil }) params.merge!(api_type: 'json', how: type, id: name) @client.request_data('/api/distinguish', :post, params) refresh! end
Checks whether or not the thing was distinguished by a privileged user. @!method distinguished? @return [Boolean] Returns whether or not the comment was
distinguished.
# File lib/NeonRAW/objects/thing/moderateable.rb, line 25 def distinguished? if @distinguished.nil? false else true end end
Checks who distinguished the thing. @!method distinguished_by
@return [String, nil] Returns who distinguished the comment or nil if
the comment isn't distinguished [moderator, admin, special].
# File lib/NeonRAW/objects/thing/moderateable.rb, line 51 def distinguished_by @distinguished end
Remove a comment/link/modmail message. @!method remove!
# File lib/NeonRAW/objects/thing/moderateable.rb, line 85 def remove! params = { id: name, spam: false } @client.request_data('/api/remove', :post, params) refresh! end
Report a thing to the subreddit's moderators or admins if the thing is a private message. @!method report(reason) @param reason [String] The reason for the report (100 characters
maximum).
# File lib/NeonRAW/objects/thing/moderateable.rb, line 67 def report(reason) params = { api_type: 'json', reason: reason, thing_id: name } @client.request_data('/api/report', :post, params) end
Spamfilter a comment/link/modmail message. @!method spam!
# File lib/NeonRAW/objects/thing/moderateable.rb, line 93 def spam! params = { id: name, spam: true } @client.request_data('/api/remove', :post, params) refresh! end
Checks whether or not the thing is stickied. @!method stickied? @return [Boolean] Returns whether or not the thing is stickied.
# File lib/NeonRAW/objects/thing/moderateable.rb, line 58 def stickied? @stickied end