diff --git a/lib/redd/models/comment.rb b/lib/redd/models/comment.rb index 3aa234f..a382abe 100644 --- a/lib/redd/models/comment.rb +++ b/lib/redd/models/comment.rb @@ -205,6 +205,11 @@ class Comment < Model # @return [Boolean] whether the comment is distinguished property :distinguished?, from: :distinguished + # @return [String] the url to this specific comment + def comment_url + link.link + id + end + private def lazer_reload diff --git a/lib/redd/models/submission.rb b/lib/redd/models/submission.rb index 6969f1d..0f4a84e 100644 --- a/lib/redd/models/submission.rb +++ b/lib/redd/models/submission.rb @@ -102,6 +102,11 @@ def set_suggested_sort(suggested) # rubocop:disable Naming/AccessorMethodName client.post('/api/set_suggested_sort', id: read_attribute(:name), sort: suggested) end + # @return [String] the **absolute** url to the submission + def url + "https://www.reddit.com#{permalink}" + end + # @!attribute [r] sort_order # @return [Symbol] the comment sort order property :sort_order, :nil