Class: ChatMessage::WikiPageMessage
- Inherits:
-
BaseMessage
- Object
- BaseMessage
- ChatMessage::WikiPageMessage
- Defined in:
- app/models/project_services/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.
-
#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.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 10 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] @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
7 8 9 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 7 def action @action end |
#description ⇒ Object (readonly)
Returns the value of attribute description
8 9 10 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 8 def description @description end |
#title ⇒ Object (readonly)
Returns the value of attribute title
5 6 7 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 5 def title @title end |
#wiki_page_url ⇒ Object (readonly)
Returns the value of attribute wiki_page_url
6 7 8 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 6 def wiki_page_url @wiki_page_url end |
Instance Method Details
#activity ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 34 def activity { title: "#{user_combined_name} #{action} #{wiki_page_link}", subtitle: "in #{project_link}", text: title, image: user_avatar } end |
#attachments ⇒ Object
28 29 30 31 32 |
# File 'app/models/project_services/chat_message/wiki_page_message.rb', line 28 def return description if markdown end |