Class: Gemometer::Notifiers::Slack

Inherits:
Base
  • Object
show all
Defined in:
lib/gemometer/notifiers/slack.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#gems, #url

Instance Method Summary collapse

Methods inherited from Base

#notify

Constructor Details

#initialize(opts) ⇒ Slack

Returns a new instance of Slack.



7
8
9
10
# File 'lib/gemometer/notifiers/slack.rb', line 7

def initialize(opts)
  @channel = opts.delete(:channel)
  super(opts)
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



5
6
7
# File 'lib/gemometer/notifiers/slack.rb', line 5

def channel
  @channel
end

Instance Method Details

#messageObject



12
13
14
15
16
17
18
# File 'lib/gemometer/notifiers/slack.rb', line 12

def message
  html = "Outdated gems:\n"
  gems.each do |g|
    html += "\n    <https://rubygems.org/gems/#{g[:name]}|#{g[:name]}> (newest #{g[:newest]}, installed #{g[:installed]})"
  end
  html += "\n-"
end