Class: Thredded::PushoverNotifier::ContentHelper
- Inherits:
-
Object
- Object
- Thredded::PushoverNotifier::ContentHelper
- Includes:
- ActionView::Helpers::TextHelper
- Defined in:
- lib/thredded/pushover_notifier/content_helper.rb
Instance Attribute Summary collapse
-
#post ⇒ Object
readonly
Returns the value of attribute post.
-
#root_url ⇒ Object
readonly
Returns the value of attribute root_url.
Instance Method Summary collapse
-
#initialize(root_url, post) ⇒ ContentHelper
constructor
A new instance of ContentHelper.
- #message_for_new_topic_post ⇒ Object
- #post_url ⇒ Object
- #title_for_new_topic_post ⇒ Object
Constructor Details
#initialize(root_url, post) ⇒ ContentHelper
Returns a new instance of ContentHelper.
13 14 15 16 |
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 13 def initialize(root_url, post) @root_url = root_url @post = post end |
Instance Attribute Details
#post ⇒ Object (readonly)
Returns the value of attribute post.
11 12 13 |
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 11 def post @post end |
#root_url ⇒ Object (readonly)
Returns the value of attribute root_url.
11 12 13 |
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 11 def root_url @root_url end |
Instance Method Details
#message_for_new_topic_post ⇒ Object
18 19 20 |
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 18 def content_truncated(replace_images) end |
#post_url ⇒ Object
26 27 28 |
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 26 def post_url "#{root_url}#{post_permalink_path(post.id)}" end |
#title_for_new_topic_post ⇒ Object
22 23 24 |
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 22 def title_for_new_topic_post "#{post.postable.title} by @#{post.user.thredded_display_name} [#{post..name}]" end |