Class: ExceptionNotifier::IkachanNotifier::Client
- Inherits:
-
Object
- Object
- ExceptionNotifier::IkachanNotifier::Client
- Defined in:
- lib/exception_notifier/ikachan_notifier.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
Instance Method Summary collapse
-
#initialize(base_url) ⇒ Client
constructor
A new instance of Client.
- #notice_all(channels, message) ⇒ Object
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_url ⇒ Object (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, ) channels.each do |channel| join(channel) .each_line do |line| notice(channel, line) end end end |