Module: Snooby::Delete
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes the calling object, which is either a post or a comment, as long as it belongs to the currently authorized user.
Instance Method Details
#delete ⇒ Object
Deletes the calling object, which is either a post or a comment, as long as it belongs to the currently authorized user.
45 46 47 48 49 50 51 52 53 |
# File 'lib/snooby/actions.rb', line 45 def delete raise RedditError, 'You are not logged in.' unless Snooby.active unless self. == Snooby.active.username #raise CommonDecencyError raise RedditError, "You can't delete somebody else's content." end Snooby.request(Paths[:delete], :id => self.name) end |