Class: Integrations::ChatMessage::WikiPageMessage
- Inherits:
-
BaseMessage
- Object
- BaseMessage
- Integrations::ChatMessage::WikiPageMessage
- Defined in:
- app/models/integrations/chat_message/wiki_page_message.rb
Constant Summary
Constants inherited from BaseMessage
BaseMessage::RELATIVE_LINK_REGEX
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#diff_url ⇒ Object
readonly
Returns the value of attribute diff_url.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#wiki_page_url ⇒ Object
readonly
Returns the value of attribute wiki_page_url.
Attributes inherited from BaseMessage
#markdown, #project_name, #project_url, #user_avatar, #user_full_name, #user_name
Instance Method Summary collapse
- #activity ⇒ Object
- #attachments ⇒ Object
-
#initialize(params) ⇒ WikiPageMessage
constructor
A new instance of WikiPageMessage.
Methods inherited from BaseMessage
#fallback, #pretext, #summary, #user_combined_name
Constructor Details
#initialize(params) ⇒ WikiPageMessage
Returns a new instance of WikiPageMessage.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 12 def initialize(params) super obj_attr = params[:object_attributes] obj_attr = HashWithIndifferentAccess.new(obj_attr) @title = obj_attr[:title] @wiki_page_url = obj_attr[:url] @description = obj_attr[:message] @diff_url = obj_attr[:diff_url] @action = case obj_attr[:action] when "create" "created" when "update" "edited" end end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 8 def action @action end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 9 def description @description end |
#diff_url ⇒ Object (readonly)
Returns the value of attribute diff_url.
10 11 12 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 10 def diff_url @diff_url end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
6 7 8 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 6 def title @title end |
#wiki_page_url ⇒ Object (readonly)
Returns the value of attribute wiki_page_url.
7 8 9 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 7 def wiki_page_url @wiki_page_url end |
Instance Method Details
#activity ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 37 def activity { title: "#{strip_markup(user_combined_name)} #{action} #{wiki_page_link}", subtitle: "in #{project_link}", text: strip_markup(title), image: user_avatar } end |
#attachments ⇒ Object
31 32 33 34 35 |
# File 'app/models/integrations/chat_message/wiki_page_message.rb', line 31 def return description if markdown end |