Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/redd/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/redd/models/submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down