lib/redd/models/submission.rb in redd-0.8.0.pre.2 vs lib/redd/models/submission.rb in redd-0.8.0

- old
+ new

@@ -31,9 +31,20 @@ data = c.get("/comments/#{link_id}").body data[0][:data][:children][0][:data].merge(comments: c.unmarshal(data[1])) end end + # Get all submissions for the same url. + # @param params [Hash] A list of optional params to send with the request. + # @option params [String] :after return results after the given fullname + # @option params [String] :before return results before the given fullname + # @option params [Integer] :count (0) the number of items already seen in the listing + # @option params [1..100] :limit (25) the maximum number of things to return + # @return [Listing<Submission>] + def duplicates(**params) + @client.unmarshal(@client.get("/duplicates/#{get_attribute(:id)}", params).body[1]) + end + # Mark the link as "Not Suitable For Work". def mark_as_nsfw @client.get('/api/marknsfw', id: get_attribute(:name)) @attributes[:over_18] = true end