Class: CodeChangeNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/code_change_notification.rb

Instance Method Summary collapse

Constructor Details

#initialize(code_change_activity) ⇒ CodeChangeNotification

Returns a new instance of CodeChangeNotification.



8
9
10
# File 'lib/code_change_notification.rb', line 8

def initialize(code_change_activity)
  @code_change_activity = code_change_activity
end

Instance Method Details

#sendObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/code_change_notification.rb', line 12

def send
  code_change = code_change_activity.code_change
  owner = code_change.owner
  subject = code_change.subject

  message = code_change_activity.message
  author = code_change_activity.author
  Rubiclifier::Notification.new(
    "#{owner}: #{subject}",
    message,
    author,
    Api.current_api.favicon,
    Api.current_api.code_change_url(code_change)
  ).send
end