Class: Thredded::PushoverNotifier::ContentHelper

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TextHelper
Defined in:
lib/thredded/pushover_notifier/content_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#postObject (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_urlObject (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_postObject



18
19
20
# File 'lib/thredded/pushover_notifier/content_helper.rb', line 18

def message_for_new_topic_post
  content_truncated(replace_images)
end

#post_urlObject



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_postObject



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.messageboard.name}]"
end