Class: Integrations::ChatMessage::DeploymentMessage

Inherits:
BaseMessage
  • Object
show all
Defined in:
app/models/integrations/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.



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

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.



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

def commit_title
  @commit_title
end

#commit_urlObject (readonly)

Returns the value of attribute commit_url.



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

def commit_url
  @commit_url
end

#deployable_idObject (readonly)

Returns the value of attribute deployable_id.



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

def deployable_id
  @deployable_id
end

#deployable_urlObject (readonly)

Returns the value of attribute deployable_url.



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

def deployable_url
  @deployable_url
end

#environmentObject (readonly)

Returns the value of attribute environment.



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

def environment
  @environment
end

#short_shaObject (readonly)

Returns the value of attribute short_sha.



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

def short_sha
  @short_sha
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#user_urlObject (readonly)

Returns the value of attribute user_url.



13
14
15
# File 'app/models/integrations/chat_message/deployment_message.rb', line 13

def user_url
  @user_url
end

Instance Method Details

#activityObject



37
38
39
# File 'app/models/integrations/chat_message/deployment_message.rb', line 37

def activity
  {}
end

#attachmentsObject



28
29
30
31
32
33
34
35
# File 'app/models/integrations/chat_message/deployment_message.rb', line 28

def attachments
  return description_message if markdown

  [{
    text: format(description_message),
    color: color
  }]
end