Skip to content

Commit

Permalink
#69 Created copy_paste_info for Chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
dsomel21 committed Oct 27, 2023
1 parent 49b05c1 commit 69f56c3
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/models/chapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,29 @@ class Chapter < ApplicationRecord
else
scope :released, -> { all }
end

# @brief Generates a formatted chapter description with relevant information and links.
# @example Generating chapter description
# `Book.find(15).chapters.second.copy_paste_info`
# @return [void]
def copy_paste_info
info = <<~HEREDOC
#{self.title} (#{self.en_title})
#{self.en_short_summary}
Discover the uncensored Suraj Prakash and its English translations, summaries, and audio discourse at https://spg.dev/chapters/#{self.id}! Explore Chapter #{self.number} of #{self.book.en_title} now!
✍🏽 Explore this chapter:
https://spg.dev/chapters/#{self.id}
📖 Explore other chapters in #{self.book.en_title}:
https://spg.dev/books/#{self.book.en_title.parameterize}
☀️ Explore Gurpartap Suraj Granth - Suraj Prakash Granth (SPG)
https://spg.dev/books
HEREDOC

Rails.logger.debug info
end
end

0 comments on commit 69f56c3

Please sign in to comment.