Module: Redd::Objects::Thing::Saveable
- Included in:
- Comment, Submission
- Defined in:
- lib/redd/objects/thing/saveable.rb
Overview
Things that can be saved to a user’s account.
Instance Method Summary collapse
-
#save(category = nil) ⇒ Object
Save a link or comment (if gilded) to the user’s account.
-
#unsave ⇒ Object
Remove the link or comment from the user’s saved links.
Instance Method Details
#save(category = nil) ⇒ Object
Save a link or comment (if gilded) to the user’s account.
8 9 10 11 12 |
# File 'lib/redd/objects/thing/saveable.rb', line 8 def save(category = nil) params = { id: fullname } params[:category] = category if category post('/api/save', params) end |
#unsave ⇒ Object
Remove the link or comment from the user’s saved links.
15 16 17 |
# File 'lib/redd/objects/thing/saveable.rb', line 15 def unsave post('/api/unsave', id: fullname) end |