Class: ChatMessage::DeploymentMessage

Inherits:
BaseMessage show all
Defined in:
app/models/project_services/chat_message/deployment_message.rb

Constant Summary

Constants inherited from BaseMessage

BaseMessage::RELATIVE_LINK_REGEX

Instance Attribute Summary collapse

Attributes inherited from BaseMessage

#markdown, #project_name, #project_url, #user_avatar, #user_full_name, #user_name

Instance Method Summary collapse

Methods inherited from BaseMessage

#fallback, #pretext, #summary, #user_combined_name

Constructor Details

#initialize(data) ⇒ DeploymentMessage

Returns a new instance of DeploymentMessage.


14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/models/project_services/chat_message/deployment_message.rb', line 14

def initialize(data)
  super

  @commit_title = data[:commit_title]
  @commit_url = data[:commit_url]
  @deployable_id = data[:deployable_id]
  @deployable_url = data[:deployable_url]
  @environment = data[:environment]
  @short_sha = data[:short_sha]
  @status = data[:status]
  @user_url = data[:user_url]
end

Instance Attribute Details

#commit_titleObject (readonly)

Returns the value of attribute commit_title


5
6
7
# File 'app/models/project_services/chat_message/deployment_message.rb', line 5

def commit_title
  @commit_title
end

#commit_urlObject (readonly)

Returns the value of attribute commit_url


6
7
8
# File 'app/models/project_services/chat_message/deployment_message.rb', line 6

def commit_url
  @commit_url
end

#deployable_idObject (readonly)

Returns the value of attribute deployable_id


7
8
9
# File 'app/models/project_services/chat_message/deployment_message.rb', line 7

def deployable_id
  @deployable_id
end

#deployable_urlObject (readonly)

Returns the value of attribute deployable_url


8
9
10
# File 'app/models/project_services/chat_message/deployment_message.rb', line 8

def deployable_url
  @deployable_url
end

#environmentObject (readonly)

Returns the value of attribute environment


9
10
11
# File 'app/models/project_services/chat_message/deployment_message.rb', line 9

def environment
  @environment
end

#short_shaObject (readonly)

Returns the value of attribute short_sha


10
11
12
# File 'app/models/project_services/chat_message/deployment_message.rb', line 10

def short_sha
  @short_sha
end

#statusObject (readonly)

Returns the value of attribute status


11
12
13
# File 'app/models/project_services/chat_message/deployment_message.rb', line 11

def status
  @status
end

#user_urlObject (readonly)

Returns the value of attribute user_url


12
13
14
# File 'app/models/project_services/chat_message/deployment_message.rb', line 12

def user_url
  @user_url
end

Instance Method Details

#activityObject


34
35
36
# File 'app/models/project_services/chat_message/deployment_message.rb', line 34

def activity
  {}
end

#attachmentsObject


27
28
29
30
31
32
# File 'app/models/project_services/chat_message/deployment_message.rb', line 27

def attachments
  [{
    text: "#{project_link} with job #{deployment_link} by #{user_link}\n#{commit_link}: #{commit_title}",
    color: color
  }]
end