Module: Redd::Objects::Thing::Moderatable

Included in:
Comment, Submission
Defined in:
lib/redd/objects/thing/moderatable.rb

Overview

Things that a moderator can manage.

Instance Method Summary collapse

Instance Method Details

#approve!Object

Approve a submission.



7
8
9
# File 'lib/redd/objects/thing/moderatable.rb', line 7

def approve!
  post('/api/approve', id: fullname)
end

#distinguish(how = :yes) ⇒ Object

Distinguish a link or comment with a sigil to show that it has been created by a moderator.

Parameters:

  • how (:yes, :no, :admin, :special) (defaults to: :yes)

    How to distinguish the thing.



22
23
24
# File 'lib/redd/objects/thing/moderatable.rb', line 22

def distinguish(how = :yes)
  post('/api/distinguish', id: fullname, how: how)
end

#ignore_reportsObject

Stop getting any moderator-related reports on the thing.



32
33
34
# File 'lib/redd/objects/thing/moderatable.rb', line 32

def ignore_reports
  post('/api/ignore_reports', id: fullname)
end

#remove!(spam = false) ⇒ Object

Remove a submission.

Parameters:

  • spam (Boolean) (defaults to: false)

    Whether or not this item is removed due to it being spam.



14
15
16
# File 'lib/redd/objects/thing/moderatable.rb', line 14

def remove!(spam = false)
  post('/api/remove', id: fullname, spam: spam)
end

#undistinguishObject

Remove the sigil that shows a thing was created by a moderator.



27
28
29
# File 'lib/redd/objects/thing/moderatable.rb', line 27

def undistinguish
  distinguish(:no)
end

#unignore_reportsObject

Start getting moderator-related reports on the thing again.



37
38
39
# File 'lib/redd/objects/thing/moderatable.rb', line 37

def unignore_reports
  post('/api/unignore_reports', id: fullname)
end