Class: ExceptionNotifier::IkachanNotifier::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url) ⇒ Client

Returns a new instance of Client.



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

def initialize(base_url)
  @base_url = base_url.match(/^https?:\/\/[^\/]+\//) ? base_url : "http://#{base_url}/"
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



11
12
13
# File 'lib/exception_notifier/ikachan_notifier.rb', line 11

def base_url
  @base_url
end

Instance Method Details

#notice_all(channels, message) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/exception_notifier/ikachan_notifier.rb', line 13

def notice_all(channels, message)
  channels.each do |channel|
    join(channel)
    message.each_line do |line|
      notice(channel, line)
    end
  end
end